Skip to content
Snippets Groups Projects
Commit c00a4bd6 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

configure: Probe stage0 link flags

For consistency with later stages and CC.
parent 6354e1da
No related branches found
No related tags found
No related merge requests found
......@@ -670,8 +670,9 @@ FP_CC_SUPPORTS_TARGET([$CC_STAGE0], [CONF_CC_OPTS_STAGE0], [CONF_CXX_OPTS_STAGE0
FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE1], [CONF_CXX_OPTS_STAGE1])
FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE2], [CONF_CXX_OPTS_STAGE2])
FP_PROG_CC_LINKER_TARGET([CONF_CC_OPTS_STAGE1], [CONF_GCC_LINKER_OPTS_STAGE1])
FP_PROG_CC_LINKER_TARGET([CONF_CC_OPTS_STAGE2], [CONF_GCC_LINKER_OPTS_STAGE2])
FP_PROG_CC_LINKER_TARGET([$CC_STAGE0], [CONF_CC_OPTS_STAGE0], [CONF_GCC_LINKER_OPTS_STAGE0])
FP_PROG_CC_LINKER_TARGET([$CC], [CONF_CC_OPTS_STAGE1], [CONF_GCC_LINKER_OPTS_STAGE1])
FP_PROG_CC_LINKER_TARGET([$CC], [CONF_CC_OPTS_STAGE2], [CONF_GCC_LINKER_OPTS_STAGE2])
dnl ** See whether cc used as a linker supports -no-pie
FP_GCC_SUPPORTS_NO_PIE
......
......@@ -2,8 +2,9 @@
# -------------------
# Check to see if the C compiler used as a linker supports `--target`
#
# $1 - Variable which contains the options passed to the C compiler when compiling a C file
# $2 - Variable which contains the options passed to the C compiler when used as
# $1 - The compiler
# $2 - Variable which contains the options passed to the C compiler when compiling a C file
# $3 - Variable which contains the options passed to the C compiler when used as
# a linker
AC_DEFUN([FP_PROG_CC_LINKER_TARGET],
[
......@@ -11,17 +12,17 @@ AC_DEFUN([FP_PROG_CC_LINKER_TARGET],
echo 'int foo() { return 0; }' > conftest1.c
echo 'int main() { return 0; }' > conftest2.c
"${CC}" $$1 -c conftest1.c || AC_MSG_ERROR([Failed to compile conftest1.c])
"${CC}" $$1 -c conftest2.c || AC_MSG_ERROR([Failed to compile conftest2.c])
"$1" $$2 -c conftest1.c || AC_MSG_ERROR([Failed to compile conftest1.c])
"$1" $$2 -c conftest2.c || AC_MSG_ERROR([Failed to compile conftest2.c])
if test "$target_cpu" = "javascript"
then
# See Note [Don't pass --target to emscripten toolchain] in GHC.Toolchain.Program
CONF_CC_SUPPORTS_TARGET=NO
AC_MSG_RESULT([no])
elif "$CC" $$2 --target=$LlvmTarget -o conftest conftest1.o conftest2.o;
elif "$CC" $$3 --target=$LlvmTarget -o conftest conftest1.o conftest2.o;
then
$2="--target=$LlvmTarget $$2"
$3="--target=$LlvmTarget $$3"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment