mirror of
https://github.com/ianlancetaylor/libbacktrace.git
synced 2026-04-09 02:39:07 +08:00
bootstrap/119680 - fix cross-compiler build with --enable-host-shared
It seems that at least when cross-compiling at least collect2 pulls in objects from libbacktrace.a which is linked via LIBDEPS. But libbacktrace for the host is only built -fPIC with --enable-host-shared but not -fPIE with --enable-host-pie so this fails. The following teaches libbacktrace about --enable-host-pie and handles it similar to libcpp. PR bootstrap/119680 libbacktrace/ * configure.ac (--enable-host-pie): Handle by setting PIC_FLAG to -fPIE. * configure: Regenerate.
This commit is contained in:
committed by
Ian Lance Taylor
parent
f1104f3270
commit
0bb163df97
16
configure
vendored
16
configure
vendored
@@ -812,6 +812,7 @@ enable_darwin_at_rpath
|
|||||||
enable_largefile
|
enable_largefile
|
||||||
enable_werror
|
enable_werror
|
||||||
with_system_libunwind
|
with_system_libunwind
|
||||||
|
enable_host_pie
|
||||||
enable_host_shared
|
enable_host_shared
|
||||||
'
|
'
|
||||||
ac_precious_vars='build_alias
|
ac_precious_vars='build_alias
|
||||||
@@ -1461,6 +1462,7 @@ Optional Features:
|
|||||||
rpaths to be added to executables
|
rpaths to be added to executables
|
||||||
--disable-largefile omit support for large files
|
--disable-largefile omit support for large files
|
||||||
--disable-werror disable building with -Werror
|
--disable-werror disable building with -Werror
|
||||||
|
--enable-host-pie build host code as PIE
|
||||||
--enable-host-shared build host code as shared libraries
|
--enable-host-shared build host code as shared libraries
|
||||||
|
|
||||||
Optional Packages:
|
Optional Packages:
|
||||||
@@ -11395,7 +11397,7 @@ else
|
|||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 11398 "configure"
|
#line 11400 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
@@ -11501,7 +11503,7 @@ else
|
|||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 11504 "configure"
|
#line 11506 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
@@ -12190,12 +12192,18 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Enable --enable-host-pie.
|
||||||
|
# Check whether --enable-host-pie was given.
|
||||||
|
if test "${enable_host_pie+set}" = set; then :
|
||||||
|
enableval=$enable_host_pie; PIC_FLAG=-fPIE
|
||||||
|
else
|
||||||
|
PIC_FLAG=
|
||||||
|
fi
|
||||||
|
|
||||||
# Enable --enable-host-shared.
|
# Enable --enable-host-shared.
|
||||||
# Check whether --enable-host-shared was given.
|
# Check whether --enable-host-shared was given.
|
||||||
if test "${enable_host_shared+set}" = set; then :
|
if test "${enable_host_shared+set}" = set; then :
|
||||||
enableval=$enable_host_shared; PIC_FLAG=-fPIC
|
enableval=$enable_host_shared; PIC_FLAG=-fPIC
|
||||||
else
|
|
||||||
PIC_FLAG=
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -176,11 +176,16 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Enable --enable-host-pie.
|
||||||
|
AC_ARG_ENABLE(host-pie,
|
||||||
|
[AS_HELP_STRING([--enable-host-pie],
|
||||||
|
[build host code as PIE])],
|
||||||
|
[PIC_FLAG=-fPIE], [PIC_FLAG=])
|
||||||
# Enable --enable-host-shared.
|
# Enable --enable-host-shared.
|
||||||
AC_ARG_ENABLE(host-shared,
|
AC_ARG_ENABLE(host-shared,
|
||||||
[AS_HELP_STRING([--enable-host-shared],
|
[AS_HELP_STRING([--enable-host-shared],
|
||||||
[build host code as shared libraries])],
|
[build host code as shared libraries])],
|
||||||
[PIC_FLAG=-fPIC], [PIC_FLAG=])
|
[PIC_FLAG=-fPIC])
|
||||||
AC_SUBST(PIC_FLAG)
|
AC_SUBST(PIC_FLAG)
|
||||||
|
|
||||||
# Test for __sync support.
|
# Test for __sync support.
|
||||||
|
|||||||
Reference in New Issue
Block a user