[Git][ghc/ghc][wip/romes/remove-toolchain-runtime-config] configure: Rip out toolchain selection logic
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Mon Jun 26 19:01:39 UTC 2023
Rodrigo Mesquita pushed to branch wip/romes/remove-toolchain-runtime-config at Glasgow Haskell Compiler / GHC
Commits:
33dd1804 by Rodrigo Mesquita at 2023-06-26T20:01:26+01:00
configure: Rip out toolchain selection logic
- - - - -
23 changed files:
- configure.ac
- distrib/configure.ac.in
- − m4/check_for_gold_t22266.m4
- − m4/check_ld_copy_bug.m4
- − m4/find_ld.m4
- − m4/find_merge_objects.m4
- − m4/fp_find_nm.m4
- − m4/fp_gcc_supports_no_pie.m4
- − m4/fp_gcc_version.m4
- − m4/fp_prog_ar.m4
- − m4/fp_prog_ar_args.m4
- − m4/fp_prog_ar_is_gnu.m4
- − m4/fp_prog_ar_needs_ranlib.m4
- − m4/fp_prog_ar_supports_atfile.m4
- − m4/fp_prog_ar_supports_dash_l.m4
- − m4/fp_prog_ld_filelist.m4
- − m4/fp_prog_ld_flag.m4
- − m4/fp_prog_ld_is_gnu.m4
- − m4/fp_prog_ld_no_compact_unwind.m4
- m4/fp_setup_windows_toolchain.m4
- − m4/get_arm_isa.m4
- − m4/ghc_tables_next_to_code.m4
- m4/ghc_unregisterised.m4
Changes:
=====================================
configure.ac
=====================================
@@ -319,16 +319,6 @@ dnl ** Do an unregisterised build?
dnl --------------------------------------------------------------
GHC_UNREGISTERISED
-AC_SUBST(Unregisterised)
-
-dnl ** Do a build with tables next to code?
-dnl --------------------------------------------------------------
-
-GHC_TABLES_NEXT_TO_CODE
-if test x"$TablesNextToCode" = xYES; then
- AC_DEFINE([TABLES_NEXT_TO_CODE], [1], [Define to 1 if info tables are laid out next to code])
-fi
-AC_SUBST(TablesNextToCode)
# Requires FPTOOLS_SET_PLATFORMS_VARS to be run first.
FP_FIND_ROOT
@@ -362,15 +352,6 @@ else
fi
fi
-if test "$HostOS" = "mingw32"; then
- DllWrapCmd="$DllWrap"
- WindresCmd="$Windres"
- AC_SUBST([DllWrapCmd])
- AC_SUBST([WindresCmd])
- AC_SUBST([GenlibCmd])
- AC_SUBST([HAVE_GENLIB])
-fi
-
FP_ICONV
FP_GMP
FP_CURSES
@@ -478,22 +459,6 @@ FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
dnl ** Which ld to use
dnl --------------------------------------------------------------
AC_ARG_VAR(LD,[Use as the path to ld. See also --disable-ld-override.])
-FIND_LD([$target],[GccUseLdOpt])
-FIND_MERGE_OBJECTS()
-CONF_GCC_LINKER_OPTS_STAGE1="$CONF_GCC_LINKER_OPTS_STAGE1 $GccUseLdOpt"
-CONF_GCC_LINKER_OPTS_STAGE2="$CONF_GCC_LINKER_OPTS_STAGE2 $GccUseLdOpt"
-LdCmd="$LD"
-CFLAGS="$CFLAGS $GccUseLdOpt"
-AC_SUBST([LdCmd])
-
-FP_PROG_LD_IS_GNU
-FP_PROG_LD_BUILD_ID
-FP_PROG_LD_NO_COMPACT_UNWIND
-FP_PROG_LD_FILELIST
-
-dnl ** Which nm to use?
-dnl --------------------------------------------------------------
-FP_FIND_NM
dnl ** Which objdump to use?
dnl --------------------------------------------------------------
@@ -508,15 +473,6 @@ esac
ObjdumpCmd="$OBJDUMP"
AC_SUBST([ObjdumpCmd])
-dnl ** Which ranlib to use?
-dnl --------------------------------------------------------------
-AC_PROG_RANLIB
-if test "$RANLIB" = ":"; then
- AC_MSG_ERROR([cannot find ranlib in your PATH])
-fi
-RanlibCmd="$RANLIB"
-AC_SUBST([RanlibCmd])
-
dnl ** which strip to use?
dnl --------------------------------------------------------------
AC_CHECK_TARGET_TOOL([STRIP], [strip])
@@ -638,31 +594,7 @@ AS_IF([test x"$CcLlvmBackend" = x"YES"],
[AC_DEFINE([CC_LLVM_BACKEND], [1], [Define (to 1) if C compiler has an LLVM back end])])
AC_SUBST(CcLlvmBackend)
-FPTOOLS_SET_C_LD_FLAGS([target],[CFLAGS],[LDFLAGS],[IGNORE_LINKER_LD_FLAGS],[CPPFLAGS])
-FPTOOLS_SET_C_LD_FLAGS([build],[CONF_CC_OPTS_STAGE0],[CONF_GCC_LINKER_OPTS_STAGE0],[CONF_LD_LINKER_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
-FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE1],[CONF_GCC_LINKER_OPTS_STAGE1],[CONF_LD_LINKER_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
-FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE2],[CONF_GCC_LINKER_OPTS_STAGE2],[CONF_LD_LINKER_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
-# Stage 3 won't be supported by cross-compilation
-
-FP_LD_NO_FIXUP_CHAINS([target], [LDFLAGS])
-FP_LD_NO_FIXUP_CHAINS([build], [CONF_GCC_LINKER_OPTS_STAGE0])
-FP_LD_NO_FIXUP_CHAINS([target], [CONF_GCC_LINKER_OPTS_STAGE1])
-FP_LD_NO_FIXUP_CHAINS([target], [CONF_GCC_LINKER_OPTS_STAGE2])
-
-FP_LD_SUPPORTS_RESPONSE_FILES
-
-GHC_LLVM_TARGET_SET_VAR
-# we intend to pass trough --targets to llvm as is.
-LLVMTarget_CPP=` echo "$LlvmTarget"`
-AC_SUBST(LLVMTarget_CPP)
-# The target is substituted into the distrib/configure.ac file
-AC_SUBST(LlvmTarget)
-
-dnl ** See whether cc supports --target=<triple> and set
-dnl CONF_CC_OPTS_STAGE[012] accordingly.
-FP_CC_SUPPORTS_TARGET([$CC_STAGE0], [CONF_CC_OPTS_STAGE0], [CONF_CXX_OPTS_STAGE0], [CONF_GCC_LINKER_OPTS_STAGE0])
-FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE1], [CONF_CXX_OPTS_STAGE1], [CONF_GCC_LINKER_OPTS_STAGE1])
-FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE2], [CONF_CXX_OPTS_STAGE2], [CONF_GCC_LINKER_OPTS_STAGE2])
+FIND_GHC_TOOLCHAIN
dnl Pass -Qunused-arguments or otherwise GHC will have very noisy invocations of Clang
dnl TODO: Do we need -Qunused-arguments in CXX and GCC linker too?
@@ -670,58 +602,20 @@ FP_CC_IGNORE_UNUSED_ARGS([$CC_STAGE0], [CONF_CC_OPTS_STAGE0])
FP_CC_IGNORE_UNUSED_ARGS([$CC], [CONF_CC_OPTS_STAGE1])
FP_CC_IGNORE_UNUSED_ARGS([$CC], [CONF_CC_OPTS_STAGE2])
-# See rules/distdir-way-opts.mk for details.
-# Flags passed to the C compiler
-AC_SUBST(CONF_CC_OPTS_STAGE0)
-AC_SUBST(CONF_CC_OPTS_STAGE1)
-AC_SUBST(CONF_CC_OPTS_STAGE2)
-# Flags passed to the C compiler when we ask it to link
-AC_SUBST(CONF_GCC_LINKER_OPTS_STAGE0)
-AC_SUBST(CONF_GCC_LINKER_OPTS_STAGE1)
-AC_SUBST(CONF_GCC_LINKER_OPTS_STAGE2)
-# Flags passed to the linker when we ask it to link
-AC_SUBST(CONF_LD_LINKER_OPTS_STAGE0)
-AC_SUBST(CONF_LD_LINKER_OPTS_STAGE1)
-AC_SUBST(CONF_LD_LINKER_OPTS_STAGE2)
-# Flags passed to the C preprocessor
-AC_SUBST(CONF_CPP_OPTS_STAGE0)
-AC_SUBST(CONF_CPP_OPTS_STAGE1)
-AC_SUBST(CONF_CPP_OPTS_STAGE2)
-# Flags passed to the Haskell compiler
-AC_SUBST(CONF_HC_OPTS_STAGE0)
-AC_SUBST(CONF_HC_OPTS_STAGE1)
-AC_SUBST(CONF_HC_OPTS_STAGE2)
-
-dnl Identify C++ standard library flavour and location only when _not_ compiling
-dnl the JS backend. The JS backend uses emscripten to wrap c++ utilities which
-dnl fails this check, so we avoid it when compiling to JS.
-if test "$TargetOS" != "ghcjs"; then
- FP_FIND_CXX_STD_LIB
-fi
+# CPP, CPPFLAGS
+# --with-cpp/-with-cpp-flags
+dnl Note that we must do this after setting and using the C99 CPPFLAGS, or
+dnl otherwise risk trying to configure the C99 and LD flags using -E as a CPPFLAG
+FP_CPP_CMD_WITH_ARGS([$CC_STAGE0],[CPPCmd_STAGE0],[CONF_CPP_OPTS_STAGE0])
+FP_CPP_CMD_WITH_ARGS([$CC],[CPPCmd],[CONF_CPP_OPTS_STAGE1])
+FP_CPP_CMD_WITH_ARGS([$CC],[CPPCmd],[CONF_CPP_OPTS_STAGE2])
+AC_SUBST([CPPCmd_STAGE0])
+AC_SUBST([CPPCmd])
+
+dnl Identify C++ standard library flavour and location
+FP_FIND_CXX_STD_LIB
AC_CONFIG_FILES([mk/system-cxx-std-lib-1.0.conf])
-dnl ** Set up the variables for the platform in the settings file.
-dnl May need to use gcc to find platform details.
-dnl --------------------------------------------------------------
-FPTOOLS_SET_HASKELL_PLATFORM_VARS([Build])
-
-FPTOOLS_SET_HASKELL_PLATFORM_VARS([Host])
-AC_SUBST(HaskellHostArch)
-AC_SUBST(HaskellHostOs)
-
-FPTOOLS_SET_HASKELL_PLATFORM_VARS([Target])
-AC_SUBST(HaskellTargetArch)
-AC_SUBST(HaskellTargetOs)
-
-GHC_SUBSECTIONS_VIA_SYMBOLS
-AC_SUBST(TargetHasSubsectionsViaSymbols)
-
-GHC_IDENT_DIRECTIVE
-AC_SUBST(TargetHasIdentDirective)
-
-GHC_GNU_NONEXEC_STACK
-AC_SUBST(TargetHasGnuNonexecStack)
-
dnl ** figure out how to do context diffs
FP_PROG_CONTEXT_DIFF
@@ -731,11 +625,6 @@ chmod +x install-sh
dnl ** figure out how to do a BSD-ish install
AC_PROG_INSTALL
-dnl ** how to invoke `ar' and `ranlib'
-FP_PROG_AR_SUPPORTS_ATFILE
-FP_PROG_AR_SUPPORTS_DASH_L
-FP_PROG_AR_NEEDS_RANLIB
-
dnl ** Check to see whether ln -s works
AC_PROG_LN_S
=====================================
distrib/configure.ac.in
=====================================
@@ -119,21 +119,6 @@ dnl FP_SET_CFLAGS_C99([CC_STAGE0],[CONF_CC_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
-dnl ** Which ld to use?
-dnl --------------------------------------------------------------
-FIND_LD([$target],[GccUseLdOpt])
-FIND_MERGE_OBJECTS()
-CONF_GCC_LINKER_OPTS_STAGE1="$CONF_GCC_LINKER_OPTS_STAGE1 $GccUseLdOpt"
-CONF_GCC_LINKER_OPTS_STAGE2="$CONF_GCC_LINKER_OPTS_STAGE2 $GccUseLdOpt"
-LdCmd="$LD"
-CFLAGS="$CFLAGS $GccUseLdOpt"
-AC_SUBST([LdCmd])
-
-FP_PROG_LD_IS_GNU
-FP_PROG_LD_BUILD_ID
-FP_PROG_LD_NO_COMPACT_UNWIND
-FP_PROG_LD_FILELIST
-
dnl ** which strip to use?
dnl --------------------------------------------------------------
AC_CHECK_TARGET_TOOL([STRIP], [strip])
@@ -253,15 +238,6 @@ if test "x$TargetWordBigEndian" != "x at TargetWordBigEndian@"; then
fi
AC_SUBST(TargetWordBigEndian)
-#
-dnl ** how to invoke `ar' and `ranlib'
-#
-FP_PROG_AR_SUPPORTS_ATFILE
-FP_PROG_AR_SUPPORTS_DASH_L
-FP_PROG_AR_NEEDS_RANLIB
-RanlibCmd="$RANLIB"
-AC_SUBST([RanlibCmd])
-
dnl ** Have libdw?
dnl --------------------------------------------------------------
dnl Check for a usable version of libdw/elfutils
=====================================
m4/check_for_gold_t22266.m4 deleted
=====================================
@@ -1,89 +0,0 @@
-# CHECK_FOR_GOLD_T22266
-# ----------------------
-#
-# Test for binutils #22266. This bug manifested as GHC bug #14328 (see also:
-# #14675, #14291).
-# Uses test from
-# https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=033bfb739b525703bfe23f151d09e9beee3a2afe
-#
-# $1 = linker to test
-# Sets $result to 0 if not affected, 1 otherwise
-AC_DEFUN([CHECK_FOR_GOLD_T22266],[
- AC_MSG_CHECKING([for ld.gold object merging bug (binutils 22266)])
- if ! $1 --version | grep -q "GNU gold" 2>/dev/null; then
- # Not gold
- result=0
- elif test "$cross_compiling" = "yes"; then
- AC_MSG_RESULT([cross-compiling, assuming LD can merge objects correctly.])
- result=0
- else
- FPTOOLS_WRITE_FILE([conftest.a.c], [
- __attribute__((section(".data.a")))
- static int int_from_a_1 = 0x11223344;
-
- __attribute__((section(".data.rel.ro.a")))
- int *p_int_from_a_2 = &int_from_a_1;
-
- const char *hello (void);
-
- const char *
- hello (void)
- {
- return "XXXHello, world!" + 3;
- }
- ])
-
- FPTOOLS_WRITE_FILE([conftest.main.c], [
- #include <stdlib.h>
- #include <string.h>
-
- extern int *p_int_from_a_2;
- extern const char *hello (void);
-
- int main (void) {
- if (*p_int_from_a_2 != 0x11223344)
- abort ();
- if (strcmp(hello(), "Hello, world!") != 0)
- abort ();
- return 0;
- }
- ])
-
- FPTOOLS_WRITE_FILE([conftest.t], [
- SECTIONS
- {
- .text : {
- *(.text*)
- }
- .rodata :
- {
- *(.rodata .rodata.* .gnu.linkonce.r.*)
- }
- .data.rel.ro : {
- *(.data.rel.ro*)
- }
- .data : {
- *(.data*)
- }
- .bss : {
- *(.bss*)
- }
- }
- ])
-
- $CC -c -o conftest.a.o conftest.a.c || AC_MSG_ERROR([Failed to compile test])
- $MergeObjsCmd $MergeObjsArgs -T conftest.t conftest.a.o -o conftest.ar.o || AC_MSG_ERROR([Failed to merge test object])
-
- $CC -c -o conftest.main.o conftest.main.c || AC_MSG_ERROR([Failed to compile test driver])
- $CC conftest.ar.o conftest.main.o -o conftest || AC_MSG_ERROR([Failed to link test driver])
-
- if ./conftest; then
- AC_MSG_RESULT([not affected])
- result=0
- else
- AC_MSG_RESULT([affected])
- result=1
- fi
- rm -f conftest.a.o conftest.a.c conttest.ar.o conftest.main.c conftest.main.o conftest
- fi
-])
=====================================
m4/check_ld_copy_bug.m4 deleted
=====================================
@@ -1,61 +0,0 @@
-# CHECK_LD_COPY_BUG()
-# -------------------
-# Check for binutils bug #16177 present in some versions of the bfd ld
-# implementation affecting ARM relocations.
-# https://sourceware.org/bugzilla/show_bug.cgi?id=16177
-#
-# $1 = the platform
-#
-AC_DEFUN([CHECK_LD_COPY_BUG],[
- case $1 in
- arm*linux*)
- AC_CHECK_TARGET_TOOL([READELF], [readelf])
- AC_CHECK_TARGET_TOOL([AS], [as])
- AC_MSG_CHECKING([for ld bug 16177])
- cat >actest.s <<-EOF
- .globl _start
- .p2align 4
- _start:
- bkpt
-
- .data
- .globl data_object
- object_reference:
- .long data_object
- .size object_reference, 4
-EOF
-
- cat >aclib.s <<-EOF
- .data
- .globl data_object
- .type data_object, %object
- .size data_object, 4
- data_object:
- .long 123
-EOF
-
- $AS -o aclib.o aclib.s
- $LD -shared -o aclib.so aclib.o
-
- $AS -o actest.o actest.s
- $LD -o actest actest.o aclib.so
-
- if $READELF -r actest | grep R_ARM_COPY > /dev/null; then
- AC_MSG_RESULT([affected])
- AC_MSG_ERROR(
- [Your linker is affected by binutils #16177, which
- critically breaks linkage of GHC objects. Please either upgrade
- binutils or supply a different linker with the LD environment
- variable.])
- else
- AC_MSG_RESULT([unaffected])
- fi
-
- rm -f aclib.s aclib.o aclib.so actest.s actest.o actest
- ;;
- *)
- ;;
- esac
-])
-
-
=====================================
m4/find_ld.m4 deleted
=====================================
@@ -1,79 +0,0 @@
-# FIND_LD
-# ---------
-# Find the version of `ld` to use and figure out how to get gcc to use it for
-# linking (if --enable-ld-override is enabled). This is used in both in the top
-# level configure.ac and in distrib/configure.ac.in.
-#
-# $1 = the platform
-# $2 = the variable to set with GHC options to configure gcc to use the chosen linker
-#
-AC_DEFUN([FIND_LD],[
- AC_ARG_ENABLE(ld-override,
- [AS_HELP_STRING([--disable-ld-override],
- [Prevent GHC from overriding the default linker used by gcc. If ld-override is enabled GHC will try to tell gcc to use whichever linker is selected by the LD environment variable. [default=override enabled]])],
- [],
- [enable_ld_override=yes])
-
- find_ld() {
- # Make sure the user didn't specify LD manually.
- if test "z$LD" != "z"; then
- AC_CHECK_TARGET_TOOL([LD], [ld])
- return
- fi
-
- # Manually iterate over possible names since we want to ensure that, e.g.,
- # if ld.lld is installed but gcc doesn't support -fuse-ld=lld, that we
- # then still try ld.gold and -fuse-ld=gold.
- for possible_ld in ld.lld ld.gold ld; do
- TmpLd="" # In case the user set LD
- AC_CHECK_TARGET_TOOL([TmpLd], [$possible_ld])
- if test "x$TmpLd" = "x"; then continue; fi
-
- out=`$TmpLd --version`
- case $out in
- "GNU ld"*)
- FP_CC_LINKER_FLAG_TRY(bfd, $2) ;;
- "GNU gold"*)
- FP_CC_LINKER_FLAG_TRY(gold, $2)
- if test "$cross_compiling" = "yes"; then
- AC_MSG_NOTICE([Using ld.gold and assuming that it is not affected by binutils issue 22266]);
- fi
- ;;
- "LLD"*)
- FP_CC_LINKER_FLAG_TRY(lld, $2) ;;
- *" LLD "*)
- FP_CC_LINKER_FLAG_TRY(lld, $2) ;;
- *) AC_MSG_NOTICE([unknown linker version $out]) ;;
- esac
- if test "z$$2" = "z"; then
- AC_MSG_NOTICE([unable to convince '$CC' to use linker '$TmpLd'])
- # a terrible hack to prevent autoconf from caching the previous
- # AC_CHECK_TARGET_TOOL result since next time we'll be looking
- # for another ld variant.
- $as_unset ac_cv_prog_ac_ct_TmpLd
- else
- LD="$TmpLd"
- return
- fi
- done
-
- # Fallback
- AC_CHECK_TARGET_TOOL([LD], [ld])
- }
-
- if test "$ghc_host_os" = "darwin" ; then
- dnl N.B. Don't even try to find a more efficient linker on Darwin where
- dnl broken setups (e.g. unholy mixtures of Homebrew and the native
- dnl toolchain) are far too easy to come across.
- dnl
- dnl See #21712.
- AC_CHECK_TARGET_TOOL([LD], [ld])
- elif test "x$enable_ld_override" = "xyes"; then
- find_ld
- else
- AC_CHECK_TARGET_TOOL([LD], [ld])
- fi
-
- CHECK_LD_COPY_BUG([$1])
-])
-
=====================================
m4/find_merge_objects.m4 deleted
=====================================
@@ -1,29 +0,0 @@
-# FIND_MERGE_OBJECTS
-# ------------------
-# Find which linker to use to merge object files.
-#
-# See Note [Merging object files for GHCi] in GHC.Driver.Pipeline.
-AC_DEFUN([FIND_MERGE_OBJECTS],[
- AC_REQUIRE([FIND_LD])
-
- if test -z "$MergeObjsCmd"; then
- MergeObjsCmd="$LD"
- fi
- if test -z "$MergeObjsArgs"; then
- MergeObjsArgs="-r"
- fi
-
- CHECK_FOR_GOLD_T22266($MergeObjsCmd)
- if test "$result" = "1"; then
- AC_MSG_NOTICE([$MergeObjsCmd is broken due to binutils 22266, looking for another linker...])
- MergeObjsCmd=""
- AC_CHECK_TARGET_TOOL([MergeObjsCmd], [ld])
- CHECK_FOR_GOLD_T22266($MergeObjsCmd)
- if test "$result" = "1"; then
- AC_MSG_ERROR([Linker is affected by binutils 22266 but couldn't find another unaffected linker. Please set the MergeObjsCmd variable to a functional linker.])
- fi
- fi
-
- AC_SUBST([MergeObjsCmd])
- AC_SUBST([MergeObjsArgs])
-])
=====================================
m4/fp_find_nm.m4 deleted
=====================================
@@ -1,40 +0,0 @@
-# FP_FIND_NM
-# ---------------------
-# Find nm and verify that it works.
-AC_DEFUN([FP_FIND_NM],
-[
- if test "$HostOS" != "mingw32"; then
- AC_CHECK_TARGET_TOOL([NM], [nm])
- if test "$NM" = ":"; then
- AC_MSG_ERROR([cannot find nm in your PATH])
- fi
- fi
- NmCmd="$NM"
- AC_SUBST([NmCmd])
-
- if test "$TargetOS_CPP" = "darwin"
- then
- AC_MSG_CHECKING(whether nm program is broken)
- # Some versions of Xcode ship a broken version of `nm`. Detect and work
- # around this issue. See : https://gitlab.haskell.org/ghc/ghc/issues/11744
- nmver=$(${NM} --version | grep version | sed 's/ //g')
- case "$nmver" in
- LLVMversion7.3.0|LLVMversion7.3.1)
- AC_MSG_RESULT(yes)
- echo "The detected nm program is broken."
- echo
- echo "See: https://gitlab.haskell.org/ghc/ghc/issues/11744"
- echo
- echo "Try re-running configure with:"
- echo
- echo ' NM=$(xcrun --find nm-classic) ./configure'
- echo
- exit 1
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac
- fi
-])
-
=====================================
m4/fp_gcc_supports_no_pie.m4 deleted
=====================================
@@ -1,19 +0,0 @@
-# FP_GCC_SUPPORTS_NO_PIE
-# ----------------------
-# Does gcc support the -no-pie option? If so we should pass it to gcc when
-# joining objects since -pie may be enabled by default.
-AC_DEFUN([FP_GCC_SUPPORTS_NO_PIE],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_MSG_CHECKING([whether CC supports -no-pie])
- echo 'int main() { return 0; }' > conftest.c
- # Some GCC versions only warn when passed an unrecognized flag.
- if $CC -no-pie -Werror -x c conftest.c -o conftest > conftest.txt 2>&1 && ! grep -i unrecognized conftest.txt > /dev/null 2>&1; then
- CONF_GCC_SUPPORTS_NO_PIE=YES
- AC_MSG_RESULT([yes])
- else
- CONF_GCC_SUPPORTS_NO_PIE=NO
- AC_MSG_RESULT([no])
- fi
- rm -f conftest.c conftest.o conftest
-])
=====================================
m4/fp_gcc_version.m4 deleted
=====================================
@@ -1,27 +0,0 @@
-# FP_GCC_VERSION
-# -----------
-# Extra testing of the result AC_PROG_CC, testing the gcc version no. Sets the
-# (unsubstituted) output variable GccVersion.
-AC_DEFUN([FP_GCC_VERSION], [
- AC_REQUIRE([AC_PROG_CC])
- if test -z "$CC"; then
- AC_MSG_ERROR([C compiler is required])
- fi
-
- if $CC --version | grep -q gcc; then
- AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version],
- [
- # Be sure only to look at the first occurrence of the "version " string;
- # Some Apple compilers emit multiple messages containing this string.
- AC_MSG_CHECKING([version of gcc])
- fp_cv_gcc_version="`$CC -v 2>&1 | sed -n -e '1,/version /s/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/p'`"
- AC_MSG_RESULT([$fp_cv_gcc_version])
- # 4.7 is needed for __atomic_ builtins.
- FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.7],
- [AC_MSG_ERROR([Need at least gcc version 4.7 (newer recommended)])])
- ])
- AC_SUBST([GccVersion], [$fp_cv_gcc_version])
- else
- AC_MSG_NOTICE([\$CC is not gcc; assuming it's a reasonably new C compiler])
- fi
-])# FP_GCC_VERSION
=====================================
m4/fp_prog_ar.m4 deleted
=====================================
@@ -1,24 +0,0 @@
-# FP_PROG_AR
-# ----------
-# Sets fp_prog_ar to a path to ar. Exits if no ar can be found
-# The host normalization on Windows breaks autoconf, it no longer
-# thinks that target == host so it never checks the unqualified
-# tools for Windows. See #14274.
-AC_DEFUN([FP_PROG_AR],
-[AC_SUBST(fp_prog_ar,$AR)
-if test -z "$fp_prog_ar"; then
- if test "$HostOS" = "mingw32"
- then
- AC_PATH_PROG([fp_prog_ar], [ar])
- if test -n "$fp_prog_ar"; then
- fp_prog_ar=$(cygpath -m $fp_prog_ar)
- fi
- else
- AC_CHECK_TARGET_TOOL([AR], [ar])
- fp_prog_ar="$AR"
- fi
-fi
-if test -z "$fp_prog_ar"; then
- AC_MSG_ERROR([cannot find ar in your PATH, no idea how to make a library])
-fi
-])# FP_PROG_AR
=====================================
m4/fp_prog_ar_args.m4 deleted
=====================================
@@ -1,36 +0,0 @@
-# FP_PROG_AR_ARGS
-# ---------------
-# Sets fp_prog_ar_args to the arguments for ar and the output variable ArCmd
-# to an invocation of ar including these arguments.
-AC_DEFUN([FP_PROG_AR_ARGS],
-[AC_REQUIRE([FP_PROG_AR_IS_GNU])
-AC_CACHE_CHECK([for ar arguments], [fp_cv_prog_ar_args],
-[
-# GNU ar needs special treatment: it appears to have problems with
-# object files with the same name if you use the 's' modifier, but
-# simple 'ar q' works fine, and doesn't need a separate ranlib.
-if test $fp_prog_ar_is_gnu = yes; then
- fp_cv_prog_ar_args="q"
-else
- touch conftest.dummy
- for fp_var in qclsZ qcls qcs qcl qc ; do
- rm -f conftest.a
- if "$fp_prog_ar" $fp_var conftest.a conftest.dummy > /dev/null 2> /dev/null ; then
- # Also check that a result was created; it seems some llvm-ar versions
- # exit with code zero even if they fail to parse the command line.
- if test -f conftest.a ; then
- fp_cv_prog_ar_args=$fp_var
- break
- fi
- fi
- done
- rm -f conftest*
- if test -z "$fp_cv_prog_ar_args"; then
- AC_MSG_ERROR([cannot figure out how to use your $fp_prog_ar])
- fi
-fi])
-fp_prog_ar_args=$fp_cv_prog_ar_args
-AC_SUBST([ArCmd], ["$fp_prog_ar"])
-AC_SUBST([ArArgs], ["$fp_prog_ar_args"])
-
-])# FP_PROG_AR_ARGS
=====================================
m4/fp_prog_ar_is_gnu.m4 deleted
=====================================
@@ -1,14 +0,0 @@
-# FP_PROG_AR_IS_GNU
-# -----------------
-# Sets fp_prog_ar_is_gnu to yes or no, depending on whether it is GNU ar or not.
-AC_DEFUN([FP_PROG_AR_IS_GNU],
-[AC_REQUIRE([FP_PROG_AR])
-AC_CACHE_CHECK([whether $fp_prog_ar is GNU ar], [fp_cv_prog_ar_is_gnu],
-[if "$fp_prog_ar" --version 2> /dev/null | grep "GNU" > /dev/null 2>&1; then
- fp_cv_prog_ar_is_gnu=yes
-else
- fp_cv_prog_ar_is_gnu=no
-fi])
-fp_prog_ar_is_gnu=$fp_cv_prog_ar_is_gnu
-AC_SUBST([ArIsGNUAr], [`echo $fp_prog_ar_is_gnu | tr 'a-z' 'A-Z'`])
-])# FP_PROG_AR_IS_GNU
=====================================
m4/fp_prog_ar_needs_ranlib.m4 deleted
=====================================
@@ -1,49 +0,0 @@
-# FP_PROG_AR_NEEDS_RANLIB
-# -----------------------
-# Sets the output variable RANLIB_CMD to "ranlib" if it is needed and
-# found, to "true" otherwise. Sets REAL_RANLIB_CMD to the ranlib program,
-# even if we don't need ranlib (libffi might still need it).
-AC_DEFUN([FP_PROG_AR_NEEDS_RANLIB],[
- AC_REQUIRE([FP_PROG_AR_IS_GNU])
- AC_REQUIRE([FP_PROG_AR_ARGS])
- AC_REQUIRE([AC_PROG_CC])
-
- AC_PROG_RANLIB
-
- if test $fp_prog_ar_is_gnu = yes
- then
- fp_cv_prog_ar_needs_ranlib=no
- elif test "$TargetVendor_CPP" = "apple"
- then
- # It's quite tedious to check for Apple's crazy timestamps in
- # .a files, so we hardcode it.
- fp_cv_prog_ar_needs_ranlib=yes
- else
- case $fp_prog_ar_args in
- *s*)
- fp_cv_prog_ar_needs_ranlib=no;;
- *)
- fp_cv_prog_ar_needs_ranlib=yes;;
- esac
- fi
-
- # workaround for AC_PROG_RANLIB which sets RANLIB to `:' when
- # ranlib is missing on the target OS. The problem is that
- # ghc-cabal cannot execute `:' which is a shell built-in but can
- # execute `true' which is usually simple program supported by the
- # OS.
- # Fixes #8795
- if test "$RANLIB" = ":"
- then
- RANLIB="true"
- fi
- REAL_RANLIB_CMD="$RANLIB"
- if test $fp_cv_prog_ar_needs_ranlib = yes
- then
- RANLIB_CMD="$RANLIB"
- else
- RANLIB_CMD="true"
- fi
- AC_SUBST([REAL_RANLIB_CMD])
- AC_SUBST([RANLIB_CMD])
-])# FP_PROG_AR_NEEDS_RANLIB
=====================================
m4/fp_prog_ar_supports_atfile.m4 deleted
=====================================
@@ -1,26 +0,0 @@
-# FP_PROG_AR_SUPPORTS_ATFILE
-# -----------------
-# Sets fp_prog_ar_supports_atfile to yes or no, depending on whether
-# or not it supports the @file syntax
-AC_DEFUN([FP_PROG_AR_SUPPORTS_ATFILE],
-[AC_REQUIRE([FP_PROG_AR])
- AC_REQUIRE([FP_PROG_AR_ARGS])
-AC_CACHE_CHECK([whether $fp_prog_ar supports @file], [fp_cv_prog_ar_supports_atfile],
-[
-rm -f conftest*
-touch conftest.file
-echo conftest.file > conftest.atfile
-echo conftest.file >> conftest.atfile
-"$fp_prog_ar" $fp_prog_ar_args conftest.a @conftest.atfile > /dev/null 2>&1
-fp_prog_ar_supports_atfile_tmp=`"$fp_prog_ar" t conftest.a 2> /dev/null | grep -c conftest.file`
-rm -f conftest*
-if test "$fp_prog_ar_supports_atfile_tmp" -eq 2
-then
- fp_cv_prog_ar_supports_atfile=yes
-else
- fp_cv_prog_ar_supports_atfile=no
-fi])
-fp_prog_ar_supports_atfile=$fp_cv_prog_ar_supports_atfile
-AC_SUBST([ArSupportsAtFile], [`echo $fp_prog_ar_supports_atfile | tr 'a-z' 'A-Z'`])
-])# FP_PROG_AR_SUPPORTS_ATFILE
-
=====================================
m4/fp_prog_ar_supports_dash_l.m4 deleted
=====================================
@@ -1,30 +0,0 @@
-# FP_PROG_AR_SUPPORTS_DASH_L
-# -----------------
-# Sets fp_prog_ar_supports_dash_l to yes or no, depending on whether
-# or not it supports the llvm-ar's -L flag to merge archives.
-AC_DEFUN([FP_PROG_AR_SUPPORTS_DASH_L],
-[
- AC_REQUIRE([FP_PROG_AR])
- AC_REQUIRE([FP_PROG_AR_ARGS])
- AC_CACHE_CHECK([whether $fp_prog_ar supports -L], [fp_cv_prog_ar_supports_dash_l],
- [
- rm -f conftest*
- touch conftest.file
- touch conftest.a0 conftest.a1 conftest.b0 conftest.b1
- dnl Build two archives, merge them, and check that the result contains the
- dnl original files not the two archives.
- "$fp_prog_ar" qc conftest-a.a conftest.a0 conftest.a1
- "$fp_prog_ar" qc conftest-b.a conftest.b0 conftest.b1
- "$fp_prog_ar" qcL conftest.a conftest-a.a conftest-b.a 2>/dev/null
- if "$fp_prog_ar" t conftest.a | grep -s "conftest.a1" > /dev/null
- then
- fp_cv_prog_ar_supports_dash_l=yes
- else
- fp_cv_prog_ar_supports_dash_l=no
- fi
- rm -f conftest*
- ])
- fp_prog_ar_supports_dash_l=$fp_cv_prog_ar_supports_dash_l
- AC_SUBST([ArSupportsDashL], [`echo $fp_prog_ar_supports_dash_l | tr 'a-z' 'A-Z'`])
-])# FP_PROG_AR_SUPPORTS_DASH_L
-
=====================================
m4/fp_prog_ld_filelist.m4 deleted
=====================================
@@ -1,25 +0,0 @@
-# FP_PROG_LD_FILELIST
-# -------------------
-# Sets the output variable LdHasFilelist to YES if ld supports
-# -filelist, or NO otherwise.
-AC_DEFUN([FP_PROG_LD_FILELIST],
-[
-AC_CACHE_CHECK([whether ld understands -filelist], [fp_cv_ld_has_filelist],
-[
- echo 'int foo() { return 0; }' > conftest1.c
- echo 'int bar() { return 0; }' > conftest2.c
- ${CC-cc} -c conftest1.c
- ${CC-cc} -c conftest2.c
- echo conftest1.o > conftest.o-files
- echo conftest2.o >> conftest.o-files
- if ${LdCmd} -r -filelist conftest.o-files -o conftest.o > /dev/null 2>&1
- then
- fp_cv_ld_has_filelist=yes
- else
- fp_cv_ld_has_filelist=no
- fi
- rm -rf conftest*
-])
-FP_CAPITALIZE_YES_NO(["$fp_cv_ld_has_filelist"], [LdHasFilelist])
-AC_SUBST([LdHasFilelist])
-])# FP_PROG_LD_FILELIST
=====================================
m4/fp_prog_ld_flag.m4 deleted
=====================================
@@ -1,17 +0,0 @@
-# FP_PROG_LD_FLAG
-# ---------------
-# Sets the output variable $2 to $1 if ld supports the $1 flag.
-# Otherwise the variable's value is empty.
-AC_DEFUN([FP_PROG_LD_FLAG],
-[
-AC_CACHE_CHECK([whether ld understands $1], [fp_cv_$2],
-[echo 'int foo() { return 0; }' > conftest.c
-${CC-cc} -c conftest.c
-if ${LdCmd} -r $1 -o conftest2.o conftest.o > /dev/null 2>&1; then
- fp_cv_$2=$1
-else
- fp_cv_$2=
-fi
-rm -rf conftest*])
-$2=$fp_cv_$2
-])# FP_PROG_LD_FLAG
=====================================
m4/fp_prog_ld_is_gnu.m4 deleted
=====================================
@@ -1,13 +0,0 @@
-# FP_PROG_LD_IS_GNU
-# -----------------
-# Sets the output variable LdIsGNULd to YES or NO, depending on whether it is
-# GNU ld or not.
-AC_DEFUN([FP_PROG_LD_IS_GNU],[
-AC_CACHE_CHECK([whether ld is GNU ld], [fp_cv_gnu_ld],
-[[if ${LdCmd} --version 2> /dev/null | grep "GNU" > /dev/null 2>&1; then
- fp_cv_gnu_ld=YES
-else
- fp_cv_gnu_ld=NO
-fi]])
-AC_SUBST([LdIsGNULd],["$fp_cv_gnu_ld"])
-])# FP_PROG_LD_IS_GNU
=====================================
m4/fp_prog_ld_no_compact_unwind.m4 deleted
=====================================
@@ -1,18 +0,0 @@
-# FP_PROG_LD_NO_COMPACT_UNWIND
-# ----------------------------
-# Sets the output variable LdHasNoCompactUnwind to YES if ld supports
-# -no_compact_unwind, or NO otherwise.
-AC_DEFUN([FP_PROG_LD_NO_COMPACT_UNWIND],
-[
-AC_CACHE_CHECK([whether ld understands -no_compact_unwind], [fp_cv_ld_no_compact_unwind],
-[echo 'int foo() { return 0; }' > conftest.c
-${CC-cc} -c conftest.c
-if ${LdCmd} -r -no_compact_unwind -o conftest2.o conftest.o > /dev/null 2>&1; then
- fp_cv_ld_no_compact_unwind=yes
-else
- fp_cv_ld_no_compact_unwind=no
-fi
-rm -rf conftest*])
-FP_CAPITALIZE_YES_NO(["$fp_cv_ld_no_compact_unwind"], [LdHasNoCompactUnwind])
-AC_SUBST([LdHasNoCompactUnwind])
-])# FP_PROG_LD_NO_COMPACT_UNWIND
=====================================
m4/fp_setup_windows_toolchain.m4
=====================================
@@ -80,6 +80,7 @@ AC_DEFUN([FP_SETUP_WINDOWS_TOOLCHAIN],[
mingwbin="$hardtop/inplace/mingw/bin/"
mingwlib="$hardtop/inplace/mingw/lib/"
+ # TODO
CC="${mingwbin}clang.exe"
CXX="${mingwbin}clang++.exe"
=====================================
m4/get_arm_isa.m4 deleted
=====================================
@@ -1,117 +0,0 @@
-# GET_ARM_ISA
-# ----------------------------------
-# Get info about the ISA on the ARM arch
-AC_DEFUN([GET_ARM_ISA],
-[
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(
- [],
- [#if defined(__ARM_ARCH_2__) || \
- defined(__ARM_ARCH_3__) || \
- defined(__ARM_ARCH_3M__) || \
- defined(__ARM_ARCH_4__) || \
- defined(__ARM_ARCH_4T__) || \
- defined(__ARM_ARCH_5__) || \
- defined(__ARM_ARCH_5T__) || \
- defined(__ARM_ARCH_5E__) || \
- defined(__ARM_ARCH_5TE__)
- return 0;
- #else
- not pre arm v6
- #endif]
- )],
- [AC_DEFINE(arm_HOST_ARCH_PRE_ARMv6, 1, [ARM pre v6])
- AC_DEFINE(arm_HOST_ARCH_PRE_ARMv7, 1, [ARM pre v7])
- changequote(, )dnl
- ARM_ISA=ARMv5
- ARM_ISA_EXT="[]"
- changequote([, ])dnl
- ],
- [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(
- [],
- [#if defined(__ARM_ARCH_6__) || \
- defined(__ARM_ARCH_6J__) || \
- defined(__ARM_ARCH_6T2__) || \
- defined(__ARM_ARCH_6Z__) || \
- defined(__ARM_ARCH_6ZK__) || \
- defined(__ARM_ARCH_6K__) || \
- defined(__ARM_ARCH_6KZ__) || \
- defined(__ARM_ARCH_6M__)
- return 0;
- #else
- not pre arm v7
- #endif]
- )],
- [AC_DEFINE(arm_HOST_ARCH_PRE_ARMv7, 1, [ARM pre v7])
- if grep -q Raspbian /etc/issue && uname -m | grep -q armv7; then
- # Raspbian unfortunately makes some extremely questionable
- # packaging decisions, configuring gcc to compile for ARMv6
- # despite the fact that the RPi4 is ARMv8. As ARMv8 doesn't
- # support all instructions supported by ARMv6 this can
- # break. Work around this by checking uname to verify
- # that we aren't running on armv7.
- # See #17856.
- AC_MSG_NOTICE([Found compiler which claims to target ARMv6 running on ARMv7, assuming this is ARMv7 on Raspbian (see T17856)])
- ARM_ISA=ARMv7
- changequote(, )dnl
- ARM_ISA_EXT="[VFPv2]"
- changequote([, ])dnl
- else
- ARM_ISA=ARMv6
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(
- [],
- [#if defined(__VFP_FP__)
- return 0;
- #else
- no vfp
- #endif]
- )],
- [changequote(, )dnl
- ARM_ISA_EXT="[VFPv2]"
- changequote([, ])dnl
- ],
- [changequote(, )dnl
- ARM_ISA_EXT="[]"
- changequote([, ])dnl
- ]
- )
- fi],
- [changequote(, )dnl
- ARM_ISA=ARMv7
- ARM_ISA_EXT="[VFPv3,NEON]"
- changequote([, ])dnl
- ])
- ])
-
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [],
- [#if defined(__SOFTFP__)
- return 0;
- #else
- not softfp
- #endif]
- )],
- [changequote(, )dnl
- ARM_ABI="SOFT"
- changequote([, ])dnl
- ],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [],
- [#if defined(__ARM_PCS_VFP)
- return 0;
- #else
- no hard float ABI
- #endif]
- )],
- [ARM_ABI="HARD"],
- [ARM_ABI="SOFTFP"]
- )]
- )
-
- AC_SUBST(ARM_ISA)
-])
=====================================
m4/ghc_tables_next_to_code.m4 deleted
=====================================
@@ -1,41 +0,0 @@
-# GHC_TABLES_NEXT_TO_CODE
-# --------------------------------
-# Do a build with tables next to code?
-#
-# Whether the target architecture supports placing info tables
-# directly before the entry code (see TABLES_NEXT_TO_CODE in the RTS).
-# Whether we actually compile for TABLES_NEXT_TO_CODE depends on
-# whether we're building unregisterised code or not, which may be
-# decided by options to the compiler later.
-#
-# See https://gitlab.haskell.org/ghc/ghc/wikis/commentary/rts/storage/heap-objects#tables_next_to_code
-#
-AC_DEFUN([GHC_TABLES_NEXT_TO_CODE],
-[
- AC_REQUIRE([GHC_UNREGISTERISED])
- AC_MSG_CHECKING(whether target supports tables next to code)
- case "$Unregisterised" in
- NO)
- case "$TargetArch" in
- ia64|powerpc64|powerpc64le|s390x|wasm32)
- TablesNextToCodeDefault=NO
- AC_MSG_RESULT([no])
- ;;
- *)
- TablesNextToCodeDefault=YES
- AC_MSG_RESULT([yes])
- ;;
- esac
- ;;
- YES)
- TablesNextToCodeDefault=NO
- AC_MSG_RESULT([no])
- ;;
- esac
- FP_DEFAULT_CHOICE_OVERRIDE_CHECK(
- [tables-next-to-code],
- [tables next to code],
- [tables apart from code],
- [TablesNextToCode],
- [Build a tool chain with info tables laid out next to code (enabled by default when using the registerised ABI, on platforms that support it)])
-])
=====================================
m4/ghc_unregisterised.m4
=====================================
@@ -3,17 +3,6 @@
# Do an unregisterised build?
AC_DEFUN([GHC_UNREGISTERISED],
[
- AC_MSG_CHECKING(whether target supports a registerised ABI)
- case "$TargetArch" in
- i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64|riscv64|wasm32|javascript|loongarch64)
- UnregisterisedDefault=NO
- AC_MSG_RESULT([yes])
- ;;
- *)
- UnregisterisedDefault=YES
- AC_MSG_RESULT([no])
- ;;
- esac
FP_DEFAULT_CHOICE_OVERRIDE_CHECK(
[unregisterised],
[unregisterised],
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/33dd1804a554e40311cd20400d1bea645177cf09
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/33dd1804a554e40311cd20400d1bea645177cf09
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230626/7e71c740/attachment-0001.html>
More information about the ghc-commits
mailing list