mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
Merge pull request #7267 from douzzer/20240221-reproducible-build-tweaks
20240221-reproducible-build-tweaks
This commit is contained in:
28
configure.ac
28
configure.ac
@@ -451,9 +451,35 @@ then
|
||||
RANLIB=ranlib
|
||||
fi
|
||||
xxx_ranlib_flags=$(${RANLIB} --help 2>&1)
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_REPRODUCIBLE_BUILD"
|
||||
|
||||
AS_CASE([$xxx_ar_flags],[*'use zero for timestamps and uids/gids'*],[AR_FLAGS="Dcr" lt_ar_flags="Dcr"])
|
||||
AS_CASE([$xxx_ranlib_flags],[*'Use zero for symbol map timestamp'*],[RANLIB="${RANLIB} -D"])
|
||||
|
||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_REPRODUCIBLE_BUILD -g0"
|
||||
|
||||
# opportunistically use -ffile-prefix-map (added in GCC8 and LLVM10)
|
||||
|
||||
if "$CC" -ffile-prefix-map=/tmp=. -x c - -o /dev/null >/dev/null 2>&1 <<' EOF'
|
||||
#include <stdlib.h>
|
||||
int main(int argc, char **argv) {
|
||||
(void)argc; (void)argv; return 0;
|
||||
}
|
||||
EOF
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -ffile-prefix-map=\$(abs_top_srcdir)/= -ffile-prefix-map=\$(top_srcdir)/="
|
||||
fi
|
||||
|
||||
# opportunistically use linker option --build-id=none
|
||||
|
||||
if "$CC" -Wl,--build-id=none -x c - -o /dev/null >/dev/null 2>&1 <<' EOF'
|
||||
#include <stdlib.h>
|
||||
int main(int argc, char **argv) {
|
||||
(void)argc; (void)argv; return 0;
|
||||
}
|
||||
EOF
|
||||
then
|
||||
AM_LDFLAGS="$AM_LDFLAGS -Wl,--build-id=none"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user