File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,9 +451,35 @@ then
451451 RANLIB=ranlib
452452 fi
453453 xxx_ranlib_flags=$(${RANLIB} --help 2>&1)
454- AM_CFLAGS="$AM_CFLAGS -DHAVE_REPRODUCIBLE_BUILD"
454+
455455 AS_CASE ( [ $xxx_ar_flags] ,[ *'use zero for timestamps and uids/gids'*] ,[ AR_FLAGS="Dcr" lt_ar_flags="Dcr"] )
456456 AS_CASE ( [ $xxx_ranlib_flags] ,[ *'Use zero for symbol map timestamp'*] ,[ RANLIB="${RANLIB} -D"] )
457+
458+ AM_CFLAGS="$AM_CFLAGS -DHAVE_REPRODUCIBLE_BUILD -g0"
459+
460+ # opportunistically use -ffile-prefix-map (added in GCC8 and LLVM10)
461+
462+ if "$CC" -ffile-prefix-map=/tmp=. -x c - -o /dev/null >/dev/null 2>&1 <<' EOF'
463+ # include <stdlib.h>
464+ int main(int argc, char **argv) {
465+ (void)argc; (void)argv; return 0;
466+ }
467+ EOF
468+ then
469+ AM_CFLAGS="$AM_CFLAGS -ffile-prefix-map=\$(abs_top_srcdir)/= -ffile-prefix-map=\$(top_srcdir)/="
470+ fi
471+
472+ # opportunistically use linker option --build-id=none
473+
474+ if "$CC" -Wl,--build-id=none -x c - -o /dev/null >/dev/null 2>&1 <<' EOF'
475+ # include <stdlib.h>
476+ int main(int argc, char **argv) {
477+ (void)argc; (void)argv; return 0;
478+ }
479+ EOF
480+ then
481+ AM_LDFLAGS="$AM_LDFLAGS -Wl,--build-id=none"
482+ fi
457483fi
458484
459485
You can’t perform that action at this time.
0 commit comments