[Git][ghc/ghc][wip/supersven/correctly_propagate_host-build-target] Deleted 2 commits: bindist: Propagate user set $LD to ghc-toolchain
Sven Tennie pushed to branch wip/supersven/correctly_propagate_host-build-target at Glasgow Haskell Compiler / GHC WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below. Deleted commits: a0c6c7f7 by Sven Tennie at 2026-03-28T06:41:04+00:00 bindist: Propagate user set $LD to ghc-toolchain Otherwise, ghc-toolchain wrongly emits `-fuse-ld` for cross-compilers. - - - - - 0ff88825 by Sven Tennie at 2026-03-28T07:47:47+01:00 Respect user set CFLAGS, CXXFLAGS, LDFLAGS, etc. These were ignored on installs. - - - - - 1 changed file: - distrib/configure.ac.in Changes: ===================================== distrib/configure.ac.in ===================================== @@ -24,6 +24,10 @@ dnl works as expected, since we're slightly modifying how Autoconf dnl interprets build/host/target and how this interacts with $CC tests test -n "$target_alias" && ac_tool_prefix=$target_alias- +# Propagate $LD (if exists) to ghc-toolchain. Otherwise, ghc-toolchain tends to +# emit `-fuse-ld` for cross-compilers. +USER_LD="$LD" + dnl Various things from the source distribution configure bootstrap_build=@BuildPlatform@ bootstrap_host=@HostPlatform@ @@ -149,12 +153,38 @@ AC_SUBST([EnableStrictGhcToolchainCheck]) dnl ** Which gcc to use? dnl -------------------------------------------------------------- + +dnl AC_PROG_CC sets CFLAGS to `-g -O2` if the env var is empty. +dnl Same goes for AC_PROG_CXX and CXXFLAGS. Setting the vars prevents this. +dnl (`-g` increases binary sizes with debugging symbols. `-O2` may optimize +dnl symbols away, confusing the RTS linker.) +: ${CFLAGS=""} +: ${CXXFLAGS=""} + AC_PROG_CC([cc gcc clang]) AC_PROG_CXX([c++ g++ clang++]) # Work around #24324 MOVE_TO_FLAGS([CC],[CFLAGS]) MOVE_TO_FLAGS([CXX],[CXXFLAGS]) +dnl Save the original user-provided environment variables immediately +dnl before any m4 macros modify them. These will be passed to ghc-toolchain +dnl so it can make independent decisions and reach the same conclusions as autoconf. +USER_CONF_CC_OPTS_STAGE2="$CFLAGS" +USER_CONF_CXX_OPTS_STAGE2="$CXXFLAGS" +USER_CONF_GCC_LINKER_OPTS_STAGE2="$LDFLAGS" +USER_CPP_ARGS="$CPPFLAGS" +USER_HS_CPP_ARGS="$HaskellCPPArgs" +USER_JS_CPP_ARGS="$JavaScriptCPPArgs" +USER_CMM_CPP_ARGS="$CmmCPPArgs" + +dnl Initialize CONF_* variables with user-provided environment variables +dnl so that subsequent configure checks modify them and both autoconf and +dnl ghc-toolchain see the same values +CONF_CC_OPTS_STAGE2="$CFLAGS" +CONF_CXX_OPTS_STAGE2="$CXXFLAGS" +CONF_GCC_LINKER_OPTS_STAGE2="$LDFLAGS" + dnl ** figure out how to invoke the C preprocessor (i.e. `gcc -E`) AC_PROG_CPP View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/136d30c62cc80e7e5f738dd93af805d... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/136d30c62cc80e7e5f738dd93af805d... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Sven Tennie (@supersven)