mirror of
https://github.com/ianlancetaylor/libbacktrace.git
synced 2026-04-06 01:19: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
@@ -176,11 +176,16 @@ else
|
||||
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.
|
||||
AC_ARG_ENABLE(host-shared,
|
||||
[AS_HELP_STRING([--enable-host-shared],
|
||||
[build host code as shared libraries])],
|
||||
[PIC_FLAG=-fPIC], [PIC_FLAG=])
|
||||
[PIC_FLAG=-fPIC])
|
||||
AC_SUBST(PIC_FLAG)
|
||||
|
||||
# Test for __sync support.
|
||||
|
||||
Reference in New Issue
Block a user