Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: untangle CURLDEBUG and DEBUGBUILD macros #13718

Closed
wants to merge 6 commits into from

Commits on May 27, 2024

  1. Configuration menu
    Copy the full SHA
    d771a22 View commit details
    Browse the repository at this point in the history
  2. autotools: rely on DEBUGBUILD to enable checksrc

    Instead of `CURLDEBUG`, which did work in most cases because debug
    builds (almost?) always enable `CURLDEBUG`, but it's not accurate.
    
    Unless this was chosen intentionally for some reason I'm missing.
    (E.g. to enable this for non-debug builds with `--enable-curldebug`?
    But this option means `Enable curl debug memory tracking`, which
    seems to suggest otherwise.)
    vszakats committed May 27, 2024
    Configuration menu
    Copy the full SHA
    bcbc9a2 View commit details
    Browse the repository at this point in the history
  3. src: use header from lib instead of repeating the declaration

    To fix:
    
    MSVS: CMake, VS2022, Debug, x64, Schannel, Shared, DEBUGBUILD=ON, CURLDEBUG=OFF
    ```
    unity_0_c.obj : error LNK2019: unresolved external symbol curl_easy_perform_ev referenced in function serial_transfers [curl\_bld\src\curl.vcxproj]
        10>curl\_bld\src\curl.exe : fatal error LNK1120: 1 unresolved externals
    ```
    Ref: https://ci.appveyor.com/project/curlorg/curl/builds/49852346/job/v71t14kc6os47s31#L261
    
    mingw-w64: CMake, mingw-w64, gcc 13, Debug, x64, Schannel, Shared, DEBUGBUILD=ON, CURLDEBUG=OFF
    ```
    CMakeFiles/curl.dir/objects.a(unity_0_c.c.obj): in function `serial_transfers':
    1447C:/projects/curl/src/tool_operate.c:2495:(.text+0x18777): undefined reference to `curl_easy_perform_ev'
    ```
    Ref: https://ci.appveyor.com/project/curlorg/curl/builds/49852346/job/lig8hj3570knux38#L197
    
    But, this was not enough because we're using libcurl.def for exporting
    functions and curl_easy_perform_ev() is not on the list.
    
    The reason why it worked before is because CMake has special logic
    to disable symbol hiding for ENABLE_CURLDEBUG. We must now do the same
    for ENABLE_DEBUGBUILD. But, that's not so simple either because the
    only way to test DEBUGBUILD without CURLDEBUG, is passing -DDEBUGBUILD
    via CMAKE_C_FLAGS, in which case ENABLE_DEBUGBUILD is OFF.
    
    Ref: 6cf8413
    
    ~~Also CURL_EXTERN not necessary for curl_easy_perform_ev, since we rely
    on disabling symbol hiding to export this. Just like for curl_dbg_*()
    functions used for memory tracking.~~ [I misread this, CURL_EXTERN is
    actually required for non-Windows/autotools systems.]
    
    But, did this ever work for autotools / Windows builds? [It did/does,
    the trick is that dll exports are handled dynamically by libtool, so
    the hard-wirred libcurl.def list is not used here.]
    vszakats committed May 27, 2024
    Configuration menu
    Copy the full SHA
    8fd83d1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    087c089 View commit details
    Browse the repository at this point in the history
  5. GHA: add autotools/mingw-64/debugbuild/no-curldebug job

    Modify to test a fragile debug build case.
    vszakats committed May 27, 2024
    Configuration menu
    Copy the full SHA
    2e53fb6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    274f23f View commit details
    Browse the repository at this point in the history