Make modules not depend on build path (issue #1).

Use --prefix="" to ensure that no destination paths are in libraries.

Use -fdebug-prefix-map to rewrite build path so that it does not
appear in the executables.

Use -gno-record-gcc-switches to ensure that the -fdebug-prefix-map
does not appear in the executables.
This commit is contained in:
Trammell Hudson 2017-01-28 13:14:56 -05:00
parent 19cb1bcb73
commit 1411dffb6a
Failed to extract signature
6 changed files with 45 additions and 13 deletions

View File

@ -19,7 +19,10 @@ BOARD ?= qemu
# If musl-libc is being used in the initrd, set the heads_cc
# variable to point to it.
musl_dep := musl
heads_cc := $(INSTALL)/bin/musl-gcc
heads_cc := $(INSTALL)/bin/musl-gcc \
-fdebug-prefix-map=$(pwd)=heads \
-gno-record-gcc-switches \
#heads_cc := $(HOME)/install/x86_64-linux-musl/x86_64-linux-musl/bin/gcc
all: $(BOARD).rom

View File

@ -8,18 +8,23 @@ cryptsetup_tar := cryptsetup-$(cryptsetup_version).tar.xz
cryptsetup_url := https://www.kernel.org/pub/linux/utils/cryptsetup/v1.7/cryptsetup-$(cryptsetup_version).tar.xz
cryptsetup_hash := af2b04e8475cf40b8d9ffd97a1acfa73aa787c890430afd89804fb544d6adc02
# Use an empty prefix so that the executables will not include the
# build path.
cryptsetup_configure := ./configure \
CC="$(heads_cc)" \
CFLAGS="-I$(INSTALL)/include" \
LDFLAGS="-L$(INSTALL)/lib" \
--host i386-elf-linux \
--prefix "$(INSTALL)" \
--prefix "" \
--disable-gcrypt-pbkdf2 \
--with-crypto_backend=kernel \
# but after building, replace prefix so that they will be installed
# in the correct directory.
cryptsetup_target := \
-j 8 \
install
&& $(MAKE) \
-C $(build)/$(cryptsetup_dir) \
prefix="$(INSTALL)" \
install
cryptsetup_output := \
src/.libs/cryptsetup \

View File

@ -8,10 +8,15 @@ gpg_tar := gnupg-$(gpg_version).tar.bz2
gpg_url := https://www.gnupg.org/ftp/gcrypt/gnupg/$(gpg_tar)
gpg_hash := 6b47a3100c857dcab3c60e6152e56a997f2c7862c1b8b2b25adf3884a1ae2276
# For reproducibility reasons we have to override the exec_prefix
# and datarootdir on the configure line so that the Makefiles will
# be generated with the correct paths, but then re-write them when
# we use the install target so that they will be copied to the correct
# location.
gpg_configure := ./configure \
CC="$(heads_cc)" \
--host i386-elf-linux \
--prefix $(INSTALL) \
--prefix "" \
--disable-bzip2 \
--disable-gpg \
--disable-gpgsm \
@ -32,7 +37,14 @@ gpg_configure := ./configure \
--disable-dns-cert \
--disable-regex \
gpg_target := -j 8 install
# Run one build to generate the executables with the pre-defined
# exec_prefix and datarootdir, then a second make to install the binaries
# into our actual target location
gpg_target := -j 8 \
&& $(MAKE) -C $(build)/$(gpg_dir) \
exec_prefix=$(pwd)/install \
datarootdir=$(pwd)/install/share \
install
gpg_output := g10/gpgv

View File

@ -8,10 +8,14 @@ libuuid_hash := 46af3275291091009ad7f1b899de3d0cea0252737550e7919d17237997db5644
libuuid_configure := ./configure \
CC="$(heads_cc)" \
--prefix $(INSTALL) \
--prefix "" \
--host i386-elf-linux \
libuuid_target := install
libuuid_target := -j 8 && \
$(MAKE) \
-C "$(build)/$(libuuid_dir)" \
prefix="$(INSTALL)" \
install
libuuid_libraries := .libs/libuuid.so
libuuid_depends := $(musl_dep)

View File

@ -8,10 +8,14 @@ popt_hash := e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8
popt_configure := ./configure \
CC="$(heads_cc)" \
--prefix $(INSTALL) \
--prefix "" \
--host i386-elf-linux \
popt_target := install
popt_target := -j 8 \
&& $(MAKE) \
-C "$(build)/$(popt_dir)" \
prefix="$(INSTALL)" \
install
popt_libraries := ./libs/libpopt.so
popt_depends := $(musl_dep)

View File

@ -10,10 +10,14 @@ qrencode_output := .libs/libqrencode.so.$(qrencode_version)
qrencode_configure := ./configure \
CC="$(heads_cc)" \
--prefix $(INSTALL) \
--prefix "" \
--without-tools \
--host i386-elf-linux \
qrencode_target := install
qrencode_target := -j 8 \
&& $(MAKE) \
-C "$(build)/$(qrencode_dir)" \
prefix="$(INSTALL)" \
install
qrencode_depends := $(musl_dep)