curl/CMake
Viktor Szakats 7508e9ec41
cmake: fix brotli lib order
Fix root cause that caused missing symbols when linking brotli
statically with e.g. binutils `ld` (and any other "picky" linker,
or "traditional" linker as CMake now calls them).

Also drop existing workaround that added brotli libs twice to the lib
list.

```
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(decode.c.obj):decode.c:(.text$ProcessCommands[ProcessCommands]+0xbb5): undefined reference to `BrotliTransformDictionaryWord'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(decode.c.obj):decode.c:(.text$SafeProcessCommands[SafeProcessCommands]+0xe8a): undefined reference to `BrotliTransformDictionaryWord'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(decode.c.obj):decode.c:(.rdata$.refptr._kBrotliContextLookupTable[.refptr._kBrotliContextLookupTable]+0x0): undefined reference to `_kBrotliContextLookupTable'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(decode.c.obj):decode.c:(.rdata$.refptr._kBrotliPrefixCodeRanges[.refptr._kBrotliPrefixCodeRanges]+0x0): undefined reference to `_kBrotliPrefixCodeRanges'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(state.c.obj):state.c:(.text$BrotliDecoderStateInit[BrotliDecoderStateInit]+0x21): undefined reference to `BrotliDefaultAllocFunc'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(state.c.obj):state.c:(.text$BrotliDecoderStateInit[BrotliDecoderStateInit]+0x2f): undefined reference to `BrotliDefaultFreeFunc'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(state.c.obj):state.c:(.text$BrotliDecoderStateInit[BrotliDecoderStateInit]+0x10e): undefined reference to `BrotliSharedDictionaryCreateInstance'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(state.c.obj):state.c:(.text$BrotliDecoderStateCleanup[BrotliDecoderStateCleanup]+0xf4): undefined reference to `BrotliSharedDictionaryDestroyInstance'
collect2: error: ld returned 1 exit status
```

Breakage reproducible with curl-for-win config "`win-gcc`" and deleting
the `LDFLAGS+=' -Wl,--start-group'` line from its `curl.sh` script.
(Above line still required for some non-brotli cases, e.g. libssh2 and
zlib.)

Assisted-by: Kai Pastor
Ref: https://github.com/curl/curl/pull/10857#discussion_r1611714989
Follow-up to 1e3319a167 #10857
Closes #13761
2024-05-24 11:23:37 +02:00
..
Platforms file: add support for getting basic directory listings 2024-04-11 12:37:12 +02:00
cmake_uninstall.cmake.in copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CMakeConfigurableFile.in copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
curl-config.cmake.in cmake: fix multiple include of CURL package 2023-11-10 18:23:22 +00:00
CurlSymbolHiding.cmake cmake: lib CURL_STATICLIB fixes (Windows) 2023-09-25 22:05:29 +00:00
CurlTests.c cmake: fix HAVE_IOCTLSOCKET_FIONBIO test with gcc 14 2024-05-11 10:56:37 +02:00
FindBearSSL.cmake copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
FindBrotli.cmake cmake: fix brotli lib order 2024-05-24 11:23:37 +02:00
FindCARES.cmake copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
FindGSS.cmake cmake: use list APPEND syntax for CMAKE_REQUIRED_DEFINITIONS 2023-01-24 03:09:09 -05:00
FindLibPSL.cmake copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
FindLibSSH2.cmake copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
FindMbedTLS.cmake copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
FindMSH3.cmake copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
FindNGHTTP2.cmake cmake: FindNGHTTP2 add static lib name to find_library call 2024-04-29 16:49:06 +02:00
FindNGHTTP3.cmake copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
FindNGTCP2.cmake h3: add support for ngtcp2 with AWS-LC builds 2023-10-08 22:35:04 +00:00
FindQUICHE.cmake copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
FindWolfSSL.cmake copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
FindZstd.cmake cmake: speed up zstd detection 2023-10-27 00:37:34 +00:00
Macros.cmake docs: ascii version of manpage without nroff 2024-03-06 15:55:59 +01:00
OtherTests.cmake cmake: tidy-up OtherTests.cmake 2023-12-19 12:45:24 +00:00
PickyWarnings.cmake cmake: enable -pedantic-errors for clang when CURL_WERROR=ON 2024-04-05 13:05:36 +00:00
Utilities.cmake cmake: fix function description in comment [ci skip] 2024-02-06 22:20:33 +00:00