# # # patch "gnu/dist/binutils/bfd/archive.c" # from [1b641c43829786113e2658b64aa7afa69ed2163c] # to [564fbfc24ad9bb8c8c6296572a28419567a4136e] # # patch "gnu/dist/binutils/bfd/bfd-in2.h" # from [e9525545bdea1bf3b994d35c64554807a4a0babd] # to [6e026c964420ba233bb11b7f69f52dcc2998141b] # # patch "gnu/dist/binutils/binutils/ar.c" # from [ab5c9bf677bed21f5bad55d5a51fa1dff9c94838] # to [0f35293b9571ba8f782d4045404e9e8b510a37fc] # # patch "gnu/dist/binutils/binutils/objcopy.c" # from [dd1ace08766b8efcb72649fdb40856a75afc327c] # to [8c46e54121a599a3a97fd4eb9cbe84698b3340fc] # # patch "gnu/dist/gcc4/gcc/tree.c" # from [8a80f27488be18ee6c4992b1a438a4b54baf2116] # to [5b0ffa82a30866653e425625d99c19999aa084f0] # # patch "gnu/dist/gcc4/libcpp/line-map.c" # from [86a7f3336bc381809aafe9fff553eb174f4fc4ef] # to [3ef15c4ac12082e712d4c575c7daec40e6b7f531] # # patch "gnu/lib/libbfd/arch/i386/bfd.h" # from [8ef4b19c935ea9d5fdbe22bfb9d35202c204f8bd] # to [67bbf288c5defda699c898be526b27dfd09048b9] # # patch "gnu/lib/libbfd/arch/x86_64/bfd.h" # from [dd4a7383759f94ed67e2345210bb3ac7874427bf] # to [4c1c717d9f0daca19a15a03aa353d95292b4ba93] # # patch "gnu/usr.bin/gdb6/bfd/arch/x86_64/bfd.h" # from [4b4a8b5dfbfd9c3fededf07602eef48054b13a71] # to [ac5891adaec61c4506ea14af4db40cf150b860c0] # # patch "gnu/usr.bin/gettext/libnlspr/Makefile" # from [99106857758125f01b609f28723cca8e261d9ff7] # to [d4dc0c5af10f85d8197d07a2eb975bbf423d51bb] # # patch "gnu/usr.bin/gettext/msginit/Makefile" # from [a619bd92314828c2e8b4e34da3f543fdd55cc8b1] # to [84d8adbfa176e1d843805ff4d08c8d3fc24ce754] # # patch "lib/libedit/el.h" # from [a2cb18693b687c8949582ca5c081b86670053e93] # to [4fe0529605a9350c2331859ca592133d16ca162b] # # patch "lib/libutil/login_cap.c" # from [3db37965d867b453e3260a52baa11bc0e407200e] # to [7462f7586211b647095c0b4b08a766e382025f9e] # # patch "share/mk/bsd.lib.mk" # from [013c77ae44736a8446210a4f977ace96f7961d1c] # to [25ccff498aa367dea60861a9645781e73cc6d0cb] # # patch "sys/rump/Makefile.rump" # from [50a1b0e4938db42ca4c76c26ae398412fdefee38] # to [43c5150aef69abe3972ebfd63cf7e52afdd090a8] # ============================================================ --- gnu/dist/binutils/bfd/archive.c 1b641c43829786113e2658b64aa7afa69ed2163c +++ gnu/dist/binutils/bfd/archive.c 564fbfc24ad9bb8c8c6296572a28419567a4136e @@ -138,6 +138,13 @@ extern int errno; extern int errno; #endif +#ifndef ULONG_MAX +#define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF */ +#endif +#ifndef LONG_MAX +#define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF */ +#endif + /* We keep a cache of archive filepointers to archive elements to speed up searching the archive by filepos. We only add an entry to the cache when we actually read one. We also don't sort the cache; @@ -1343,6 +1350,17 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, c return NULL; } + /* If the caller requested that the BFD generate deterministic output, + fake values for UID, GID, and modification times. */ + if ((abfd->flags & BFD_DETERMINISTIC_OUTPUT) != 0) + { + status.st_mtime = 0; + status.st_uid = 0; + status.st_gid = 0; + } + else + fprintf (stderr, "XXXNETBSD %s:%d\n", __FILE__, __LINE__); + amt = sizeof (struct ar_hdr) + sizeof (struct areltdata); ared = bfd_zalloc (abfd, amt); if (ared == NULL) @@ -1919,19 +1937,53 @@ bsd_write_armap (bfd *arch, struct stat statbuf; unsigned int i; char tmpbuf[11]; + long uid, gid; firstreal = mapsize + elength + sizeof (struct ar_hdr) + SARMAG; stat (arch->filename, &statbuf); + + if ((arch->flags & BFD_DETERMINISTIC_OUTPUT) == 0) + { + fprintf (stderr, "XXXNETBSD %s:%d\n", __FILE__, __LINE__); + /* Remember the timestamp, to keep it holy. But fudge it a little. */ + bfd_ardata (arch)->armap_timestamp = (statbuf.st_mtime + + ARMAP_TIME_OFFSET); + uid = getuid(); + gid = getgid(); + } + else + { + /* If deterministic, we pick a value that will compare >= + to all files' mtimes we examine later. */ + bfd_ardata (arch)->armap_timestamp = LONG_MAX; + uid = 0; + gid = 0; + } + memset (&hdr, 0, sizeof (struct ar_hdr)); sprintf (hdr.ar_name, RANLIBMAG); - /* Remember the timestamp, to keep it holy. But fudge it a little. */ - bfd_ardata (arch)->armap_timestamp = statbuf.st_mtime + ARMAP_TIME_OFFSET; bfd_ardata (arch)->armap_datepos = (SARMAG + offsetof (struct ar_hdr, ar_date[0])); - sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp); - sprintf (hdr.ar_uid, "%ld", (long) getuid ()); - sprintf (hdr.ar_gid, "%ld", (long) getgid ()); + if ((arch->flags & BFD_DETERMINISTIC_OUTPUT) == 0) + { + fprintf (stderr, "XXXNETBSD %s:%d\n", __FILE__, __LINE__); + sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp); + } + else + { + /* If deterministic output was requested, stuff the largest value + in the field that we can. On readback, if this overflows 'long', + the LONG_MAX will be used which will compare favorably to any + actual file modification time. If 'long' does not overflow, this + is the largest value we can represent while leaving a trailing + space. (Without a trailing space, archive-reading code might + break.) */ + memset(hdr.ar_date, '9', sizeof (hdr.ar_date) - 1); + hdr.ar_date[sizeof (hdr.ar_date)] = ' '; + } + sprintf (hdr.ar_uid, "%ld", uid); + sprintf (hdr.ar_gid, "%ld", gid); sprintf (tmpbuf, "%-10d", (int) mapsize); memcpy(hdr.ar_size, tmpbuf, sizeof(hdr.ar_size)); strncpy (hdr.ar_fmag, ARFMAG, 2); @@ -2094,7 +2146,23 @@ coff_write_armap (bfd *arch, hdr.ar_name[0] = '/'; sprintf (tmpbuf, "%-10d", (int) mapsize); memcpy(hdr.ar_size, tmpbuf, sizeof(hdr.ar_size)); - sprintf (hdr.ar_date, "%ld", (long) time (NULL)); + if ((arch->flags & BFD_DETERMINISTIC_OUTPUT) == 0) + { + fprintf (stderr, "XXXNETBSD %s:%d\n", __FILE__, __LINE__); + sprintf (hdr.ar_date, "%ld", (long) time (NULL)); + } + else + { + /* If deterministic output was requested, stuff the largest value + in the field that we can. On readback, if this overflows 'long', + the LONG_MAX will be used which will compare favorably to any + actual file modification time. If 'long' does not overflow, this + is the largest value we can represent while leaving a trailing + space. (Without a trailing space, archive-reading code might + break.) */ + memset(hdr.ar_date, '9', sizeof (hdr.ar_date) - 1); + hdr.ar_date[sizeof (hdr.ar_date)] = ' '; + } /* This, at least, is what Intel coff sets the values to. */ sprintf ((hdr.ar_uid), "%d", 0); sprintf ((hdr.ar_gid), "%d", 0); ============================================================ --- gnu/dist/binutils/bfd/bfd-in2.h e9525545bdea1bf3b994d35c64554807a4a0babd +++ gnu/dist/binutils/bfd/bfd-in2.h 6e026c964420ba233bb11b7f69f52dcc2998141b @@ -241,6 +241,12 @@ bfd_format; /* This BFD has been created by the linker and doesn't correspond to any input file. */ #define BFD_LINKER_CREATED 0x2000 + +/* This may be set before writing out a BFD to request that it + be written using values for UIDs, GIDs, timestamps, etc. that + will be consistent from run to run. */ +#define BFD_DETERMINISTIC_OUTPUT 0x4000 + /* Symbols and relocation. */ ============================================================ --- gnu/dist/binutils/binutils/ar.c ab5c9bf677bed21f5bad55d5a51fa1dff9c94838 +++ gnu/dist/binutils/binutils/ar.c 0f35293b9571ba8f782d4045404e9e8b510a37fc @@ -105,6 +105,9 @@ int write_armap = 0; if any of the members are object files. */ int write_armap = 0; +/* XXX */ +int deterministic = 0; + /* Nonzero means it's the name of an existing member; position new or moved files with respect to this one. */ char *posname = NULL; @@ -233,6 +236,7 @@ usage (int help) fprintf (s, _(" command specific modifiers:\n")); fprintf (s, _(" [a] - put file(s) after [member-name]\n")); fprintf (s, _(" [b] - put file(s) before [member-name] (same as [i])\n")); + fprintf (s, _(" [D] - generate deterministic output\n")); fprintf (s, _(" [N] - use instance [count] of name\n")); fprintf (s, _(" [f] - truncate inserted file names\n")); fprintf (s, _(" [P] - use full path names when matching\n")); @@ -553,6 +557,9 @@ main (int argc, char **argv) case 'P': full_pathname = TRUE; break; + case 'D': + deterministic = TRUE; + break; default: /* xgettext:c-format */ non_fatal (_("illegal option -- %c"), c); @@ -606,6 +613,9 @@ main (int argc, char **argv) if (newer_only && operation != replace) fatal (_("`u' is only meaningful with the `r' option.")); + if (newer_only && deterministic) + fatal (_("`u' is not meaningful with the `D' option.")); + if (postype != pos_default) posname = argv[arg_index++]; @@ -944,6 +954,9 @@ write_archive (bfd *iarch) obfd->flags |= BFD_TRADITIONAL_FORMAT; } + if (deterministic) + obfd->flags |= BFD_DETERMINISTIC_OUTPUT; + if (!bfd_set_archive_head (obfd, contents_head)) bfd_fatal (old_name); ============================================================ --- gnu/dist/binutils/binutils/objcopy.c dd1ace08766b8efcb72649fdb40856a75afc327c +++ gnu/dist/binutils/binutils/objcopy.c 8c46e54121a599a3a97fd4eb9cbe84698b3340fc @@ -74,6 +74,7 @@ static bfd_boolean preserve_dates; /* Pr static bfd_boolean verbose; /* Print file and target names. */ static bfd_boolean preserve_dates; /* Preserve input file timestamp. */ +static bfd_boolean deterministic; /* Preserve input file timestamp. */ static int status = 0; /* Exit status. */ enum strip_action @@ -259,6 +260,7 @@ static struct option strip_options[] = { {"discard-all", no_argument, 0, 'x'}, {"discard-locals", no_argument, 0, 'X'}, + {"deterministic", no_argument, 0, 'D'}, {"format", required_argument, 0, 'F'}, /* Obsolete */ {"help", no_argument, 0, 'h'}, {"info", no_argument, 0, OPTION_FORMATS_INFO}, @@ -305,6 +307,7 @@ static struct option copy_options[] = {"debugging", no_argument, 0, OPTION_DEBUGGING}, {"discard-all", no_argument, 0, 'x'}, {"discard-locals", no_argument, 0, 'X'}, + {"deterministic", no_argument, 0, 'D'}, {"format", required_argument, 0, 'F'}, /* Obsolete */ {"gap-fill", required_argument, 0, OPTION_GAP_FILL}, {"help", no_argument, 0, 'h'}, @@ -401,6 +404,7 @@ copy_usage (FILE *stream, int exit_statu -I --input-target Assume input file is in format \n\ -O --output-target Create an output file in format \n\ -B --binary-architecture Set arch of output file, when input is binary\n\ + -D --deterministic Deterministic output\n\ -F --target Set both input and output format to \n\ --debugging Convert debugging information, if possible\n\ -p --preserve-dates Copy modified/access timestamps to the output\n\ @@ -487,6 +491,7 @@ strip_usage (FILE *stream, int exit_stat fprintf (stream, _(" Removes symbols and sections from files\n")); fprintf (stream, _(" The options are:\n")); fprintf (stream, _("\ + -D --deterministic Deterministic output\n\ -I --input-target= Assume input file is in format \n\ -O --output-target= Create an output file in format \n\ -F --target= Set both input and output format to \n\ @@ -1605,6 +1610,9 @@ copy_archive (bfd *ibfd, bfd *obfd, cons bfd_get_filename (this_element)); } + if (deterministic) + output_bfd->flags |= BFD_DETERMINISTIC_OUTPUT; + l = xmalloc (sizeof (struct name_list)); l->name = output_name; l->next = list; @@ -1630,6 +1638,7 @@ copy_archive (bfd *ibfd, bfd *obfd, cons } else { + /* XXXNETBSD deterministic? */ if (preserve_dates && stat_status == 0) set_times (output_name, &buf); @@ -1705,6 +1714,9 @@ copy_file (const char *input_filename, c if (obfd == NULL) RETURN_NONFATAL (output_filename); + if (deterministic) + obfd->flags |= BFD_DETERMINISTIC_OUTPUT; + copy_archive (ibfd, obfd, output_target); } else if (bfd_check_format_matches (ibfd, bfd_object, &obj_matching)) @@ -1724,6 +1736,9 @@ copy_file (const char *input_filename, c delete = ! copy_object (ibfd, obfd); + if (deterministic) + obfd->flags |= BFD_DETERMINISTIC_OUTPUT; + if (!bfd_close (obfd)) RETURN_NONFATAL (output_filename); @@ -2317,6 +2332,9 @@ strip_main (int argc, char *argv[]) { switch (c) { + case 'D': + deterministic = TRUE; + break; case 'I': input_target = optarg; break; @@ -2477,6 +2495,10 @@ copy_main (int argc, char *argv[]) binary_architecture = optarg; break; + case 'D': + deterministic = TRUE; + break; + case 'i': interleave = atoi (optarg); if (interleave < 1) ============================================================ --- gnu/dist/gcc4/gcc/tree.c 8a80f27488be18ee6c4992b1a438a4b54baf2116 +++ gnu/dist/gcc4/gcc/tree.c 5b0ffa82a30866653e425625d99c19999aa084f0 @@ -5929,12 +5929,20 @@ get_file_function_name_long (const char unsigned len; const char *name = weak_global_object_name; const char *file = main_input_filename; + const char *prefix; if (! name) name = ""; if (! file) file = input_filename; + if ((prefix = getenv("CPLUS_STRIP_FILE_PREFIX")) != NULL) + { + size_t l = strlen (prefix); + if (strncmp (file, prefix, l) == 0) + file += l; + } + len = strlen (file); q = alloca (9 * 2 + len + 1); memcpy (q, file, len + 1); ============================================================ --- gnu/dist/gcc4/libcpp/line-map.c 86a7f3336bc381809aafe9fff553eb174f4fc4ef +++ gnu/dist/gcc4/libcpp/line-map.c 3ef15c4ac12082e712d4c575c7daec40e6b7f531 @@ -104,7 +104,19 @@ linemap_add (struct line_maps *set, enum if (to_file && *to_file == '\0') to_file = ""; + else if (to_file != NULL) + { + const char *prefix; + if ((prefix = getenv ("CPP_STRIP_FILE_PREFIX")) != NULL) + { + size_t l = strlen (prefix); + + if (strncmp (to_file, prefix, l) == 0) + to_file += l; + } + } + /* If we don't keep our line maps consistent, we can easily segfault. Don't rely on the client to do it for us. */ if (set->depth == 0) ============================================================ --- gnu/lib/libbfd/arch/i386/bfd.h 8ef4b19c935ea9d5fdbe22bfb9d35202c204f8bd +++ gnu/lib/libbfd/arch/i386/bfd.h 67bbf288c5defda699c898be526b27dfd09048b9 @@ -244,6 +244,11 @@ bfd_format; /* This BFD has been created by the linker and doesn't correspond to any input file. */ #define BFD_LINKER_CREATED 0x2000 + +/* This may be set before writing out a BFD to request that it + be written using values for UIDs, GIDs, timestamps, etc. that + will be consistent from run to run. */ +#define BFD_DETERMINISTIC_OUTPUT 0x4000 /* Symbols and relocation. */ ============================================================ --- gnu/lib/libbfd/arch/x86_64/bfd.h dd4a7383759f94ed67e2345210bb3ac7874427bf +++ gnu/lib/libbfd/arch/x86_64/bfd.h 4c1c717d9f0daca19a15a03aa353d95292b4ba93 @@ -244,6 +244,11 @@ bfd_format; /* This BFD has been created by the linker and doesn't correspond to any input file. */ #define BFD_LINKER_CREATED 0x2000 + +/* This may be set before writing out a BFD to request that it + be written using values for UIDs, GIDs, timestamps, etc. that + will be consistent from run to run. */ +#define BFD_DETERMINISTIC_OUTPUT 0x4000 /* Symbols and relocation. */ ============================================================ --- gnu/usr.bin/gdb6/bfd/arch/x86_64/bfd.h 4b4a8b5dfbfd9c3fededf07602eef48054b13a71 +++ gnu/usr.bin/gdb6/bfd/arch/x86_64/bfd.h ac5891adaec61c4506ea14af4db40cf150b860c0 @@ -249,6 +249,11 @@ bfd_format; /* This BFD has been created by the linker and doesn't correspond to any input file. */ #define BFD_LINKER_CREATED 0x2000 + +/* This may be set before writing out a BFD to request that it + be written using values for UIDs, GIDs, timestamps, etc. that + will be consistent from run to run. */ +#define BFD_DETERMINISTIC_OUTPUT 0x4000 /* Symbols and relocation. */ ============================================================ --- gnu/usr.bin/gettext/libnlspr/Makefile 99106857758125f01b609f28723cca8e261d9ff7 +++ gnu/usr.bin/gettext/libnlspr/Makefile d4dc0c5af10f85d8197d07a2eb975bbf423d51bb @@ -70,9 +70,9 @@ CPPFLAGS+=-I${DIST}/gettext/gettext-tool .PATH: ${DIST}/gettext/gettext-tools/src ${DIST}/gettext/gettext-tools/lib CPPFLAGS+=-I${DIST}/gettext/gettext-runtime/intl CPPFLAGS+=-I${DIST}/gettext/gettext-tools/src -CPPFLAGS+=-DLIBDIR=\"${DESTDIR}/usr/share\" -CPPFLAGS+=-DGETTEXTJAR=\"${DESTDIR}/usr/share/gettext/gettext.jar\" -CPPFLAGS+=-DGETTEXTDATADIR=\"${DESTDIR}/usr/share/gettext\" +CPPFLAGS+=-DLIBDIR=\"/usr/share\" +CPPFLAGS+=-DGETTEXTJAR=\"/usr/share/gettext/gettext.jar\" +CPPFLAGS+=-DGETTEXTDATADIR=\"/usr/share/gettext\" COPTS.format-java.c = -Wno-stack-protector COPTS.msgl-cat.c = -Wno-stack-protector ============================================================ --- gnu/usr.bin/gettext/msginit/Makefile a619bd92314828c2e8b4e34da3f543fdd55cc8b1 +++ gnu/usr.bin/gettext/msginit/Makefile 84d8adbfa176e1d843805ff4d08c8d3fc24ce754 @@ -9,9 +9,9 @@ CPPFLAGS+=-I${DIST}/gettext/gettext-runt .include "${.CURDIR}/../Makefile.inc.prog" CPPFLAGS+=-I${DIST}/gettext/gettext-runtime/intl -CPPFLAGS+=-DLIBDIR=\"${DESTDIR}/usr/share\" \ - -DPROJECTSDIR=\"${DESTDIR}/usr/share\" \ - -DLOCALE_ALIAS_PATH=\"${DESTDIR}/usr/share/locale\" +CPPFLAGS+=-DLIBDIR=\"/usr/share\" \ + -DPROJECTSDIR=\"/usr/share\" \ + -DLOCALE_ALIAS_PATH=\"/usr/share/locale\" COPTS.msginit.c = -Wno-stack-protector COPTS.localealias.c = -Wno-stack-protector ============================================================ --- lib/libedit/el.h a2cb18693b687c8949582ca5c081b86670053e93 +++ lib/libedit/el.h 4fe0529605a9350c2331859ca592133d16ca162b @@ -141,7 +141,7 @@ protected int el_editmode(EditLine *, in #ifdef DEBUG #define EL_ABORT(a) do { \ fprintf(el->el_errfile, "%s, %d: ", \ - __FILE__, __LINE__); \ + __func__, __LINE__); \ fprintf a; \ abort(); \ } while( /*CONSTCOND*/0); ============================================================ --- lib/libutil/login_cap.c 3db37965d867b453e3260a52baa11bc0e407200e +++ lib/libutil/login_cap.c 7462f7586211b647095c0b4b08a766e382025f9e @@ -85,7 +85,7 @@ login_getclass(const char *class) } if ((lc = malloc(sizeof(login_cap_t))) == NULL) { - syslog(LOG_ERR, "%s:%d malloc: %m", __FILE__, __LINE__); + syslog(LOG_ERR, "%s malloc: %m", __func__); return (0); } @@ -96,7 +96,7 @@ login_getclass(const char *class) class = LOGIN_DEFCLASS; if ((lc->lc_class = strdup(class)) == NULL) { - syslog(LOG_ERR, "%s:%d strdup: %m", __FILE__, __LINE__); + syslog(LOG_ERR, "%s strdup: %m", __func__); free(lc); return (0); } ============================================================ --- share/mk/bsd.lib.mk 013c77ae44736a8446210a4f977ace96f7961d1c +++ share/mk/bsd.lib.mk 25ccff498aa367dea60861a9645781e73cc6d0cb @@ -434,6 +434,16 @@ _YLSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YH _YLSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}} +.if !defined(DETERMINISTIC_BUILD) +ARFLAGS= cq +ARCHIVEBUILDCMD= ${RANLIB} ${.TARGET} +ARCHIVEINSTALLCMD= ${empty(PRESERVE):?-a "${RANLIB} -t":} +.else +ARFLAGS= cqD +ARCHIVEBUILDCMD= : +ARCHIVEINSTALLCMD= +.endif + .NOPATH: ${ALLOBJS} ${_LIBS} ${_YLSRCS} realall: ${SRCS} ${ALLOBJS:O} ${_LIBS} @@ -444,15 +454,15 @@ __archivebuild: .USE __archivebuild: .USE ${_MKTARGET_BUILD} rm -f ${.TARGET} - ${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}` - ${RANLIB} ${.TARGET} + ${AR} ${ARFLAGS} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}` + ${ARCHIVEBUILDCMD} .endif .if !target(__archiveinstall) __archiveinstall: .USE ${_MKTARGET_INSTALL} ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${empty(PRESERVE):?-a "${RANLIB} -t":} ${.ALLSRC} ${.TARGET} + ${ARCHIVEINSTALLCMD} ${.ALLSRC} ${.TARGET} .endif __archivesymlinkpic: .USE ============================================================ --- sys/rump/Makefile.rump 50a1b0e4938db42ca4c76c26ae398412fdefee38 +++ sys/rump/Makefile.rump 43c5150aef69abe3972ebfd63cf7e52afdd090a8 @@ -34,6 +34,16 @@ DPSRCS+= ${RUMPTOP}/Makefile.rump # If this file changes, we need a full rebuild DPSRCS+= ${RUMPTOP}/Makefile.rump +.if !defined(DETERMINISTIC_BUILD) +ARFLAGS= cq +ARCHIVEBUILDCMD= ${RANLIB} ${.TARGET} +OBJCOPYFLAGS= +.else +ARFLAGS= cqD +ARCHIVEBUILDCMD= : +OBJCOPYFLAGS= --deterministic --preserve-dates +.endif + # # Rename library symbols before use. If a symbol does not already belong # to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns". This @@ -56,11 +66,11 @@ __archivebuild: .USE __archivebuild: .USE ${_MKTARGET_BUILD} rm -f ${.TARGET} - ${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}` + ${AR} ${ARFLAGS} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}` ${NM} -go ${.TARGET} | ${TOOL_AWK} ' \ $$NF!~/^(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'${_SYMQUIRK}')/ \ {printf "%s rumpns_%s\n", $$NF, $$NF}' \ | sort | uniq > renametab.${.TARGET} - ${OBJCOPY} --redefine-syms renametab.${.TARGET} ${.TARGET} - rm -f renametab.${.TARGET} - ${RANLIB} ${.TARGET} + ${OBJCOPY} ${OBJCOPYFLAGS} --redefine-syms renametab.${.TARGET} ${.TARGET} + #rm -f renametab.${.TARGET} + ${ARCHIVEBUILDCMD}