summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-04-27 11:40:26 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-04-27 11:40:26 (EDT)
commitd6d61ef14d6e96fde9ee008adc396690aae4a469 (patch)
tree01c8354200c5857aeca160b6f9bef4ad72dcb0f1 /build
parent7edb66174d4c9212e7540dac44676a8f6341e771 (diff)
build: Set GCC's ELF INTERP.
Diffstat (limited to 'build')
-rwxr-xr-xbuild12
1 files changed, 12 insertions, 0 deletions
diff --git a/build b/build
index 81142cb..b8088aa 100755
--- a/build
+++ b/build
@@ -2,6 +2,16 @@
base_version = $$(printf '%s\n' '$(OPK_SOURCE)' | sed 's/^gcc-//')
+# /lib/<target>/ld.so is a symbolic link for use by GCC to find the system's
+# dynamic linker. It should be provided by the development package of any
+# standard C library.
+# ProteanOS GCC should build binaries with an ELF INTERP field as follows:
+# /lib/<target>/<soname>
+# <soname> is the SONAME of the target's dynamic linker.
+elf_interp = /lib/$(target)/$(elf_interp_soname)
+elf_interp_soname = $$(readelf -d "/lib/$(target)/ld.so" | \
+ sed -n 's/^.*(SONAME).*\[\([^]]*\)\].*$$/\1/p')
+
common_opts = \
--with-pkgversion='GCC for ProteanOS' \
--program-suffix="-$(base_version)" \
@@ -11,6 +21,8 @@ common_opts = \
--without-included-gettext \
--with-nls \
--with-sysroot="$${OPK_SYSROOT:-/}" \
+ --with-stage1-ldflags="-Wl,--dynamic-linker=$(elf_interp)" \
+ --with-boot-ldflags="-Wl,--dynamic-linker=$(elf_interp)" \
--enable-clocale=gnu
full_opts = \