[Differential] [Request, 25 lines] D3237: Fix ar default deterministic mode for -x
emaste created this revision. emaste added reviewers: jhibbits, bapt, brooks. emaste added subscribers: freebsd-toolchain-list, jhibbits. REVISION SUMMARY Reported by: @jhibbits REVISION DETAIL https://reviews.freebsd.org/D3237 AFFECTED FILES usr.bin/ar/ar.c CHANGE DETAILS diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -101,11 +101,12 @@ char*p; size_t len; int i, opt; + int Dflag, Uflag; bsdar = bsdar_storage; memset(bsdar, 0, sizeof(*bsdar)); - /* Enable deterministic mode by default. */ - bsdar-options |= AR_D; + Dflag = 0; + Uflag = 0; if ((bsdar-progname = getprogname()) == NULL) bsdar-progname = ar; @@ -122,10 +123,12 @@ /* Ignored. */ break; case 'D': - bsdar-options |= AR_D; + Dflag = 1; + Uflag = 0; break; case 'U': - bsdar-options = ~AR_D; + Uflag = 1; + Dflag = 0; break; case 'V': ranlib_version(); @@ -182,7 +185,8 @@ set_mode(bsdar, opt); break; case 'D': - bsdar-options |= AR_D; + Dflag = 1; + Uflag = 0; break; case 'f': case 'T': @@ -222,7 +226,8 @@ set_mode(bsdar, opt); break; case 'U': - bsdar-options = ~AR_D; + Uflag = 1; + Dflag = 0; break; case 'u': bsdar-options |= AR_U; @@ -275,16 +280,22 @@ argv++; } + /* Set determinstic mode for -D, and by default without -U. */ + if (Dflag || (Uflag == 0 (bsdar-mode == 'q' || bsdar-mode == 'r'))) + bsdar-options |= AR_D; + if (bsdar-options AR_A) only_mode(bsdar, -a, mqr); if (bsdar-options AR_B) only_mode(bsdar, -b, mqr); if (bsdar-options AR_C) only_mode(bsdar, -c, qr); if (bsdar-options AR_CC) only_mode(bsdar, -C, x); - if (bsdar-options AR_D) + if (Dflag) only_mode(bsdar, -D, qr); + if (Uflag) + only_mode(bsdar, -U, qr); if (bsdar-options AR_O) only_mode(bsdar, -o, x); if (bsdar-options AR_SS) EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, jhibbits, bapt, brooks Cc: jhibbits, freebsd-toolchain-list diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -101,11 +101,12 @@ char *p; size_t len; int i, opt; + int Dflag, Uflag; bsdar = bsdar_storage; memset(bsdar, 0, sizeof(*bsdar)); - /* Enable deterministic mode by default. */ - bsdar-options |= AR_D; + Dflag = 0; + Uflag = 0; if ((bsdar-progname = getprogname()) == NULL) bsdar-progname = ar; @@ -122,10 +123,12 @@ /* Ignored. */ break; case 'D': -bsdar-options |= AR_D; +Dflag = 1; +Uflag = 0; break; case 'U': -bsdar-options = ~AR_D; +Uflag = 1; +Dflag = 0; break; case 'V': ranlib_version(); @@ -182,7 +185,8 @@ set_mode(bsdar, opt); break; case 'D': - bsdar-options |= AR_D; + Dflag = 1; + Uflag = 0; break; case 'f': case 'T': @@ -222,7 +226,8 @@ set_mode(bsdar, opt); break; case 'U': - bsdar-options = ~AR_D; + Uflag = 1; + Dflag = 0; break; case 'u': bsdar-options |= AR_U; @@ -275,16 +280,22 @@ argv++; } + /* Set determinstic mode for -D, and by default without -U. */ + if (Dflag || (Uflag == 0 (bsdar-mode == 'q' || bsdar-mode == 'r'))) + bsdar-options |= AR_D; + if (bsdar-options AR_A) only_mode(bsdar, -a, mqr); if (bsdar-options AR_B) only_mode(bsdar, -b, mqr); if (bsdar-options AR_C) only_mode(bsdar, -c, qr); if (bsdar-options AR_CC) only_mode(bsdar, -C, x); - if (bsdar-options AR_D) + if (Dflag) only_mode(bsdar, -D, qr); + if (Uflag) + only_mode(bsdar, -U, qr); if (bsdar-options AR_O) only_mode(bsdar, -o, x); if (bsdar-options AR_SS) ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 2, 362 lines] D3238: Remove old GNU Binutils tools now provided by ELF Tool Chain
emaste created this revision. emaste added reviewers: bapt, brooks, imp. emaste added a subscriber: freebsd-toolchain-list. REVISION SUMMARY Posting for comment, review and testing. REVISION DETAIL https://reviews.freebsd.org/D3238 AFFECTED FILES UPDATING gnu/usr.bin/binutils/Makefile gnu/usr.bin/binutils/addr2line/Makefile gnu/usr.bin/binutils/addr2line/Makefile.depend gnu/usr.bin/binutils/addr2line/addr2line.1 gnu/usr.bin/binutils/ar/Makefile.depend gnu/usr.bin/binutils/nm/Makefile gnu/usr.bin/binutils/nm/Makefile.depend gnu/usr.bin/binutils/nm/nm.1 gnu/usr.bin/binutils/ranlib/Makefile.depend gnu/usr.bin/binutils/readelf/Makefile gnu/usr.bin/binutils/readelf/Makefile.depend gnu/usr.bin/binutils/readelf/readelf.1 gnu/usr.bin/binutils/size/Makefile gnu/usr.bin/binutils/size/Makefile.depend gnu/usr.bin/binutils/size/size.1 gnu/usr.bin/binutils/strings/Makefile gnu/usr.bin/binutils/strings/Makefile.depend gnu/usr.bin/binutils/strings/strings.1 gnu/usr.bin/binutils/strip/Makefile gnu/usr.bin/binutils/strip/Makefile.depend gnu/usr.bin/binutils/strip/strip.1 gnu/usr.bin/cc/Makefile gnu/usr.bin/cc/c++filt/Makefile gnu/usr.bin/cc/c++filt/Makefile.depend tools/build/mk/OptionalObsoleteFiles.inc tools/build/options/WITHOUT_BINUTILS tools/build/options/WITHOUT_ELFTOOLCHAIN_TOOLS EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, bapt, brooks, imp Cc: freebsd-toolchain-list diff --git a/tools/build/options/WITHOUT_ELFTOOLCHAIN_TOOLS b/tools/build/options/WITHOUT_ELFTOOLCHAIN_TOOLS --- a/tools/build/options/WITHOUT_ELFTOOLCHAIN_TOOLS +++ b/tools/build/options/WITHOUT_ELFTOOLCHAIN_TOOLS @@ -1,11 +1,10 @@ .\ $FreeBSD$ -Set to use +Set to avoid building ELF Tool Chain tools .Xr addr2line 1 , .Xr c++filt 1 , .Xr nm 1 , .Xr readelf 1 , .Xr size 1 , .Xr strings 1 , and -.Xr strip 1 -from GNU binutils instead of the ELF Tool Chain project. +.Xr strip 1 . diff --git a/tools/build/options/WITHOUT_BINUTILS b/tools/build/options/WITHOUT_BINUTILS --- a/tools/build/options/WITHOUT_BINUTILS +++ b/tools/build/options/WITHOUT_BINUTILS @@ -1,5 +1,4 @@ .\ $FreeBSD$ -Set to not build or install binutils (as, c++-filt, -ld, nm, objcopy, objdump, readelf, size and strip) as part +Set to not build or install binutils (as, ld, objcopy, and objdump ) as part of the normal system build. The resulting system cannot build programs from source. diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1025,9 +1025,6 @@ .if ${MK_CXX} == no OLD_FILES+=usr/bin/CC OLD_FILES+=usr/bin/c++ -.if ${MK_ELFTOOLCHAIN_TOOLS} == no -OLD_FILES+=usr/bin/c++filt -.endif OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus .endif @@ -1656,14 +1653,16 @@ OLD_FILES+=usr/share/man/man1/elfcopy.1.gz .endif -.if ${MK_ELFTOOLCHAIN_TOOLS} == no ${MK_BINUTILS} == no +.if ${MK_ELFTOOLCHAIN_TOOLS} == no OLD_FILES+=usr/bin/addr2line +OLD_FILES+=usr/bin/c++filt OLD_FILES+=usr/bin/nm OLD_FILES+=usr/bin/readelf OLD_FILES+=usr/bin/size OLD_FILES+=usr/bin/strings OLD_FILES+=usr/bin/strip OLD_FILES+=usr/share/man/man1/addr2line.1.gz +OLD_FILES+=usr/share/man/man1/c++filt.1.gz OLD_FILES+=usr/share/man/man1/nm.1.gz OLD_FILES+=usr/share/man/man1/readelf.1.gz OLD_FILES+=usr/share/man/man1/size.1.gz @@ -1753,9 +1752,6 @@ .endif .if ${MK_GCC} == no -.if ${MK_ELFTOOLCHAIN_TOOLS} == no -OLD_FILES+=usr/bin/c++filt -.endif OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/bin/gcc OLD_FILES+=usr/bin/gcov diff --git a/gnu/usr.bin/cc/c++filt/Makefile.depend b/gnu/usr.bin/cc/c++filt/Makefile.depend deleted file mode 100644 --- a/gnu/usr.bin/cc/c++filt/Makefile.depend +++ /dev/null @@ -1,23 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - -DIRDEPS = \ - gnu/lib/csu \ - gnu/lib/libgcc \ - gnu/usr.bin/cc/cc_tools \ - gnu/usr.bin/cc/libiberty \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libc_nonshared \ - lib/libcompiler_rt \ - - -.include dirdeps.mk - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/gnu/usr.bin/cc/c++filt/Makefile b/gnu/usr.bin/cc/c++filt/Makefile deleted file mode 100644 --- a/gnu/usr.bin/cc/c++filt/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ - -MAN= -.include bsd.own.mk - -.include ../Makefile.inc -.include ../Makefile.fe - -.PATH: ${GCCLIB}/libiberty - -PROG= c++filt -SRCS= cp-demangle.c - -CFLAGS+= -DSTANDALONE_DEMANGLER -DVERSION=\$(GCC_VERSION)\ - -DPADD= ${LIBIBERTY} -LDADD= ${LIBIBERTY} - -.include bsd.prog.mk diff --git a/gnu/usr.bin/cc/Makefile b/gnu/usr.bin/cc/Makefile --- a/gnu/usr.bin/cc/Makefile +++ b/gnu/usr.bin/cc/Makefile @@ -13,9 +13,6 @@ .if ${MK_CXX} != no SUBDIR+= cc1plus c++ -.if ${MK_ELFTOOLCHAIN_TOOLS} == no -SUBDIR+= c++filt -.endif
[Differential] [Closed] D3175: ar: add -U (unique) option to disable -D (deterministic) mode
This revision was automatically updated to reflect the committed changes. Closed by commit rS285844: ar: add -U (unique) option to disable -D (deterministic) mode (authored by emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D3175?vs=7235id=7268#toc REPOSITORY rS FreeBSD src repository CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D3175?vs=7235id=7268 REVISION DETAIL https://reviews.freebsd.org/D3175 AFFECTED FILES head/usr.bin/ar/ar.1 head/usr.bin/ar/ar.c EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, imp, brooks, bapt Cc: freebsd-toolchain-list diff --git a/head/usr.bin/ar/ar.1 b/head/usr.bin/ar/ar.1 --- a/head/usr.bin/ar/ar.1 +++ b/head/usr.bin/ar/ar.1 @@ -23,7 +23,7 @@ .\ .\ $FreeBSD$ .\ -.Dd December 22, 2011 +.Dd July 24, 2015 .Dt AR 1 .Os .Sh NAME @@ -66,6 +66,7 @@ .Op Fl D .Op Fl f .Op Fl s | Fl S +.Op Fl U .Op Fl v .Op Fl z .Ar archive @@ -82,6 +83,7 @@ .Op Fl j .Op Fl s | Fl S .Op Fl u +.Op Fl U .Op Fl v .Op Fl z .Ar archive @@ -112,6 +114,7 @@ .Fl M .Nm ranlib .Op Fl D +.Op Fl U .Ar archive ... .Sh DESCRIPTION The @@ -207,6 +210,11 @@ .Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. +If multiple +.Fl D +and +.Fl U +options are specified on the command line, the final one takes precedence. .It Fl f Synonymous with option .Fl T . @@ -316,6 +324,19 @@ .Ar will be extracted only if they are newer than the corresponding files in the file system. +.It Fl U +When used in combination with the +.Fl r +or +.Fl q +option, insert the real mtime, uid and gid, and file mode values +from the members named by arguments +.Ar . +If multiple +.Fl D +and +.Fl U +options are specified on the command line, the final one takes precedence. .It Fl v Provide verbose output. When used with the diff --git a/head/usr.bin/ar/ar.c b/head/usr.bin/ar/ar.c --- a/head/usr.bin/ar/ar.c +++ b/head/usr.bin/ar/ar.c @@ -113,15 +113,18 @@ len = strlen(bsdar-progname); if (len = strlen(ranlib) strcmp(bsdar-progname + len - strlen(ranlib), ranlib) == 0) { - while ((opt = getopt_long(argc, argv, tDV, longopts, + while ((opt = getopt_long(argc, argv, tDUV, longopts, NULL)) != -1) { switch(opt) { case 't': /* Ignored. */ break; case 'D': bsdar-options |= AR_D; break; + case 'U': +bsdar-options = ~AR_D; +break; case 'V': ranlib_version(); break; @@ -157,7 +160,7 @@ } } - while ((opt = getopt_long(argc, argv, abCcdDfijlMmopqrSsTtuVvxz, + while ((opt = getopt_long(argc, argv, abCcdDfijlMmopqrSsTtUuVvxz, longopts, NULL)) != -1) { switch(opt) { case 'a': @@ -216,6 +219,9 @@ case 't': set_mode(bsdar, opt); break; + case 'U': + bsdar-options = ~AR_D; + break; case 'u': bsdar-options |= AR_U; break; @@ -364,9 +370,9 @@ (void)fprintf(stderr, \tar -m [-Tjsvz] archive file ...\n); (void)fprintf(stderr, \tar -m [-Tabijsvz] position archive file ...\n); (void)fprintf(stderr, \tar -p [-Tv] archive [file ...]\n); - (void)fprintf(stderr, \tar -q [-TcDjsvz] archive file ...\n); - (void)fprintf(stderr, \tar -r [-TcDjsuvz] archive file ...\n); - (void)fprintf(stderr, \tar -r [-TabcDijsuvz] position archive file ...\n); + (void)fprintf(stderr, \tar -q [-TcDjsUvz] archive file ...\n); + (void)fprintf(stderr, \tar -r [-TcDjsUuvz] archive file ...\n); + (void)fprintf(stderr, \tar -r [-TabcDijsUuvz] position archive file ...\n); (void)fprintf(stderr, \tar -s [-jz] archive\n); (void)fprintf(stderr, \tar -t [-Tv] archive [file ...]\n); (void)fprintf(stderr, \tar -x [-CTouv] archive [file ...]\n); @@ -378,7 +384,7 @@ ranlib_usage(void) { - (void)fprintf(stderr, usage: ranlib [-t] archive ...\n); + (void)fprintf(stderr, usage: ranlib [-DtU] archive ...\n); (void)fprintf(stderr, \tranlib -V\n); exit(EX_USAGE); } ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D2338: readelf: avoid division by zero for files with invalid sh_entsize
This revision was automatically updated to reflect the committed changes. Closed by commit rS285845: readelf: avoid division by zero on section entry size (authored by emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D2338?vs=7069id=7269#toc REPOSITORY rS FreeBSD src repository CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D2338?vs=7069id=7269 REVISION DETAIL https://reviews.freebsd.org/D2338 AFFECTED FILES head/contrib/elftoolchain/readelf/readelf.c EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, brooks Cc: brooks, freebsd-toolchain-list diff --git a/head/contrib/elftoolchain/readelf/readelf.c b/head/contrib/elftoolchain/readelf/readelf.c --- a/head/contrib/elftoolchain/readelf/readelf.c +++ b/head/contrib/elftoolchain/readelf/readelf.c @@ -27,6 +27,7 @@ #include sys/param.h #include sys/queue.h #include ar.h +#include assert.h #include ctype.h #include dwarf.h #include err.h @@ -314,6 +315,7 @@ static const char *dwarf_regname(struct readelf *re, unsigned int num); static struct dumpop *find_dumpop(struct readelf *re, size_t si, const char *sn, int op, int t); +static int get_ent_count(struct section *s, int *ent_count); static char *get_regoff_str(struct readelf *re, Dwarf_Half reg, Dwarf_Addr off); static const char *get_string(struct readelf *re, int strtab, size_t off); @@ -2901,6 +2903,24 @@ #undef ST_CTL } +/* + * Return number of entries in the given section. We'd prefer ent_count be a + * size_t *, but libelf APIs already use int for section indices. + */ +static int +get_ent_count(struct section *s, int *ent_count) +{ + if (s-entsize == 0) { + warnx(section %s has entry size 0, s-name); + return (0); + } else if (s-sz / s-entsize INT_MAX) { + warnx(section %s has invalid section count, s-name); + return (0); + } + *ent_count = (int)(s-sz / s-entsize); + return (1); +} + static void dump_dynamic(struct readelf *re) { @@ -2929,8 +2949,8 @@ /* Determine the actual number of table entries. */ nentries = 0; - jmax = (int) (s-sz / s-entsize); - + if (!get_ent_count(s, jmax)) + continue; for (j = 0; j jmax; j++) { if (gelf_getdyn(d, j, dyn) != dyn) { warnx(gelf_getdyn failed: %s, @@ -3176,7 +3196,9 @@ else printf(%-12s %-12s %-19s %-16s %s\n, REL_HDR); } - len = d-d_size / s-entsize; + assert(d-d_size == s-sz); + if (!get_ent_count(s, len)) + return; for (i = 0; i len; i++) { if (gelf_getrel(d, i, r) != r) { warnx(gelf_getrel failed: %s, elf_errmsg(-1)); @@ -3232,7 +3254,9 @@ else printf(%-12s %-12s %-19s %-16s %s\n, RELA_HDR); } - len = d-d_size / s-entsize; + assert(d-d_size == s-sz); + if (!get_ent_count(s, len)) + return; for (i = 0; i len; i++) { if (gelf_getrela(d, i, r) != r) { warnx(gelf_getrel failed: %s, elf_errmsg(-1)); @@ -3297,7 +3321,7 @@ Elf_Data *d; GElf_Sym sym; const char *name; - int elferr, stab, j; + int elferr, stab, j, len; s = re-sl[i]; stab = s-link; @@ -3310,12 +3334,14 @@ } if (d-d_size = 0) return; + if (!get_ent_count(s, len)) + return; printf(Symbol table (%s), s-name); - printf( contains %ju entries:\n, s-sz / s-entsize); + printf( contains %d entries:\n, len); printf(%7s%9s%14s%5s%8s%6s%9s%5s\n, Num:, Value, Size, Type, Bind, Vis, Ndx, Name); - for (j = 0; (uint64_t)j s-sz / s-entsize; j++) { + for (j = 0; j len; j++) { if (gelf_getsym(d, j, sym) != sym) { warnx(gelf_getsym failed: %s, elf_errmsg(-1)); continue; @@ -3353,7 +3379,7 @@ Elf_Data *d; struct section *s; uint64_t dyn_off; - int elferr, i; + int elferr, i, len; /* * If -D is specified, only dump the symbol table specified by @@ -3378,8 +3404,10 @@ } if (d-d_size = 0) return; + if (!get_ent_count(s, len)) + return; - for (i = 0; (uint64_t)i s-sz / s-entsize; i++) { + for (i = 0; i len; i++) { if (gelf_getdyn(d, i, dyn) != dyn) { warnx(gelf_getdyn failed: %s, elf_errmsg(-1)); continue; @@ -3567,7 +3595,8 @@ maskwords = buf[2]; buf += 4; ds = re-sl[s-link]; - dynsymcount = ds-sz / ds-entsize; + if (!get_ent_count(ds, dynsymcount)) + return; nchain = dynsymcount - symndx; if (d-d_size != 4 * sizeof(uint32_t) + maskwords * (re-ec == ELFCLASS32 ? sizeof(uint32_t) : sizeof(uint64_t)) + @@ -3996,7 +4025,7 @@ char tbuf[20]; Elf_Data *d; Elf_Lib *lib; - int i, j, k, elferr, first; + int i, j, k, elferr, first, len; for (i = 0; (size_t) i re-shnum; i++) { s = re-sl[i]; @@ -4013,8 +4042,10 @@ if (d-d_size = 0) continue; lib = d-d_buf; + if (!get_ent_count(s, len)) + continue; printf(\nLibrary list section '%s' , s-name); - printf(contains %ju entries:\n, s-sz / s-entsize); + printf(contains %d entries:\n, len); printf(%12s%24s%18s%10s%6s\n, Library, Time Stamp, Checksum, Version, Flags); for (j = 0; (uint64_t) j s-sz / s-entsize; j++) { @@ -4399,7 +4430,7 @@ dump_mips_reginfo(struct readelf
[Differential] [Request, 2 lines] D3190: ar: enable deterministic mode by default
emaste created this revision. emaste added reviewers: bapt, brooks. emaste added a subscriber: freebsd-toolchain-list. REVISION SUMMARY Ar cannot handle UIDs with more than 6 digits, and there's little value in storing the mtime, uid, gid and mode anyhow. Turn on deterministic (-D) mode by default; it can be disabled by the user with -U. PR: 196929 Relnotes: Yes Sponsored by: The FreeBSD Foundation REVISION DETAIL https://reviews.freebsd.org/D3190 AFFECTED FILES usr.bin/ar/ar.c CHANGE DETAILS diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -104,6 +104,8 @@ bsdar = bsdar_storage; memset(bsdar, 0, sizeof(*bsdar)); + /* Enable deterministic mode by default. */ + bsdar-options |= AR_D; if ((bsdar-progname = getprogname()) == NULL) bsdar-progname = ar; EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, bapt, brooks Cc: freebsd-toolchain-list diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -104,6 +104,8 @@ bsdar = bsdar_storage; memset(bsdar, 0, sizeof(*bsdar)); + /* Enable deterministic mode by default. */ + bsdar-options |= AR_D; if ((bsdar-progname = getprogname()) == NULL) bsdar-progname = ar; ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated, 3 lines] D3190: ar: enable deterministic mode by default
emaste updated this revision to Diff 7272. emaste added a comment. Add note of -D default in man page. CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D3190?vs=7271id=7272 REVISION DETAIL https://reviews.freebsd.org/D3190 AFFECTED FILES usr.bin/ar/ar.1 usr.bin/ar/ar.c CHANGE DETAILS diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -104,6 +104,8 @@ bsdar = bsdar_storage; memset(bsdar, 0, sizeof(*bsdar)); + /* Enable deterministic mode by default. */ + bsdar-options |= AR_D; if ((bsdar-progname = getprogname()) == NULL) bsdar-progname = ar; diff --git a/usr.bin/ar/ar.1 b/usr.bin/ar/ar.1 --- a/usr.bin/ar/ar.1 +++ b/usr.bin/ar/ar.1 @@ -210,6 +210,7 @@ .Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. +This option is enabled by default. If multiple .Fl D and EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, bapt, brooks Cc: freebsd-toolchain-list diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -104,6 +104,8 @@ bsdar = bsdar_storage; memset(bsdar, 0, sizeof(*bsdar)); + /* Enable deterministic mode by default. */ + bsdar-options |= AR_D; if ((bsdar-progname = getprogname()) == NULL) bsdar-progname = ar; diff --git a/usr.bin/ar/ar.1 b/usr.bin/ar/ar.1 --- a/usr.bin/ar/ar.1 +++ b/usr.bin/ar/ar.1 @@ -210,6 +210,7 @@ .Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. +This option is enabled by default. If multiple .Fl D and ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 39 lines] D3175: ar: add -U (unique) option to disable -D (deterministic) mode
emaste created this revision. emaste added reviewers: brooks, bapt. emaste added a subscriber: freebsd-toolchain-list. REVISION SUMMARY I'd like to make ar(1) produce deterministic output by default. In order to do so we'll first need an option to turn off deterministic mode. Note that this is against upstream ELF Tool Chain ar(1), which is a little different from the one in the FreeBSD tree. I plan to migrate to ELF Tool Chain's eventually, but this change should apply (perhaps with trivial modification) to FreeBSD's. REVISION DETAIL https://reviews.freebsd.org/D3175 AFFECTED FILES ar/ar.1 ar/ar.c EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, brooks, bapt Cc: freebsd-toolchain-list diff --git a/ar/ar.c b/ar/ar.c --- a/ar/ar.c +++ b/ar/ar.c @@ -123,15 +123,18 @@ len = strlen(bsdar-progname); if (len = strlen(ranlib) strcmp(bsdar-progname + len - strlen(ranlib), ranlib) == 0) { - while ((opt = getopt_long(argc, argv, tDV, longopts, + while ((opt = getopt_long(argc, argv, tDUV, longopts, NULL)) != -1) { switch(opt) { case 't': /* Ignored. */ break; case 'D': bsdar-options |= AR_D; break; + case 'U': +bsdar-options = ~AR_D; +break; case 'V': bsdar_version(); break; @@ -169,7 +172,7 @@ } } - while ((opt = getopt_long(argc, argv, abCcdDfF:ijlMmopqrSsTtuVvxz, + while ((opt = getopt_long(argc, argv, abCcdDfF:ijlMmopqrSsTtUuVvxz, longopts, NULL)) != -1) { switch(opt) { case 'a': @@ -237,6 +240,9 @@ case 't': set_mode(bsdar, opt); break; + case 'U': + bsdar-options = ~AR_D; + break; case 'u': bsdar-options |= AR_U; break; @@ -400,7 +406,8 @@ -DUse fixed metadata, for consistent archive checksums.\n\ -F FORMAT | --flavor=FORMAT\n\ Create archives with the specified format.\n\ - -SDo not generate an archive symbol table.\n + -SDo not generate an archive symbol table.\n\ + -UUse original metadata, for unique archive checksums.\n static void bsdar_usage(void) @@ -415,6 +422,7 @@ Options:\n\ -t (This option is accepted, but ignored).\n\ -D Use fixed metadata, for consistent archive checksums.\n\ + -U Use original metadata, for unique archive checksums.\n\ -V Print a version identifier and exit.\n static void diff --git a/ar/ar.1 b/ar/ar.1 --- a/ar/ar.1 +++ b/ar/ar.1 @@ -23,7 +23,7 @@ .\ .\ $Id$ .\ -.Dd December 10, 2012 +.Dd July 23, 2015 .Os .Dt AR 1 .Sh NAME @@ -66,6 +66,7 @@ .Op Fl f .Op Fl F Ar flavor | Fl -flavor Ar flavor .Op Fl s | Fl S +.Op Fl U .Op Fl v .Op Fl z .Ar archive @@ -83,14 +84,16 @@ .Op Fl j .Op Fl s | Fl S .Op Fl u +.Op Fl U .Op Fl v .Op Fl z .Ar archive .Ar .Nm .Fl s .Op Fl D .Op Fl j +.Op Fl U .Op Fl z .Ar archive .Nm @@ -203,6 +206,12 @@ .Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. +If the +.It Fl D +and +.It Fl U +options are both specified, the one specified later in the command line +takes effect. .It Fl f Synonymous with option .Fl T . @@ -335,6 +344,20 @@ .Ar will be extracted only if they are newer than the corresponding files in the file system. +.It Fl U +When used in combination with the +.Fl r +or +.Fl q +option, insert the real mtime, uid and gid, and file mode values +from the members named by arguments +.Ar . +If the +.It Fl D +and +.It Fl U +options are both specified, the one specified later in the command line +takes effect. .It Fl v Provide verbose output. When used with the ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D2338: readelf: avoid division by zero for files with invalid sh_entsize
emaste added a comment. Yes - sorry for the delay. I realized I had a newer implementation that factored the divide-by-zero checks into a helper function, and uploaded the new diff a few days ago. REVISION DETAIL https://reviews.freebsd.org/D2338 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, brooks Cc: brooks, freebsd-toolchain-list ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 20 lines] D2933: Significantly speed up ar(1) on UFS file systems
emaste created this revision. emaste added a reviewer: kib. emaste added subscribers: davide, dim, freebsd-toolchain-list, kib. REVISION SUMMARY Fault in the buffer prior to writing as a workaround for poor performance due to interaction with kernel fs deadlock avoidance code. See the comment prior to vn_io_fault_doio() in vfs_vnops.c for details of the issue. Thanks @kib for diagnosing, providing an explanation of the issue and workaround. TEST PLAN ``` % truncate -s 16M obj.o % ar r out.a obj.o ``` Total time with stock and patched ar(1): ``` x ar.r284891 + ar.patched +--+ |+ | |+x| |+ xx| |A |A| +--+ N Min MaxMedian AvgStddev x 3 1.3071.321 1.315 1.314 0.0070237692 + 30.020.023 0.022 0.02167 0.0015275252 Difference at 95.0% confidence -1.29267 +/- 0.0115203 -98.3515% +/- 0.876513% (Student's t, pooled s = 0.00508265) ``` REVISION DETAIL https://reviews.freebsd.org/D2933 AFFECTED FILES usr.bin/ar/write.c CHANGE DETAILS diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c --- a/usr.bin/ar/write.c +++ b/usr.bin/ar/write.c @@ -41,6 +41,7 @@ #include stdlib.h #include string.h #include sysexits.h +#include unistd.h #include ar.h @@ -61,6 +62,7 @@ static void free_obj(struct bsdar *bsdar, struct ar_obj *obj); static void insert_obj(struct bsdar *bsdar, struct ar_obj *obj, struct ar_obj *pos); +static void prefault_buffer(const char *buf, size_t s); static void read_objs(struct bsdar *bsdar, const char *archive, int checkargv); static void write_archive(struct bsdar *bsdar, char mode); @@ -551,11 +553,29 @@ } /* + * Fault in the buffer prior to writing as a workaround for poor performance + * due to interaction with kernel fs deadlock avoidance code. See the comment + * prior to vn_io_fault_doio() in vfs_vnops.c for details of the issue. + */ +static void +prefault_buffer(const char *buf, size_t s) +{ + volatile const char *p; + size_t page_size; + + page_size = sysconf(_SC_PAGESIZE); + for (p = buf; p buf + s; + p += page_size - ((uintptr_t)p page_size - 1)) + *p; +} + +/* * Wrapper for archive_write_data(). */ static void write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s) { + prefault_buffer(buf, s); if (archive_write_data(a, buf, s) != (ssize_t)s) bsdar_errc(bsdar, EX_SOFTWARE, 0, %s, archive_error_string(a)); EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, kib Cc: kib, freebsd-toolchain-list, dim, davide diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c --- a/usr.bin/ar/write.c +++ b/usr.bin/ar/write.c @@ -41,6 +41,7 @@ #include stdlib.h #include string.h #include sysexits.h +#include unistd.h #include ar.h @@ -61,6 +62,7 @@ static void free_obj(struct bsdar *bsdar, struct ar_obj *obj); static void insert_obj(struct bsdar *bsdar, struct ar_obj *obj, struct ar_obj *pos); +static void prefault_buffer(const char *buf, size_t s); static void read_objs(struct bsdar *bsdar, const char *archive, int checkargv); static void write_archive(struct bsdar *bsdar, char mode); @@ -551,11 +553,29 @@ } /* + * Fault in the buffer prior to writing as a workaround for poor performance + * due to interaction with kernel fs deadlock avoidance code. See the comment + * prior to vn_io_fault_doio() in vfs_vnops.c for details of the issue. + */ +static void +prefault_buffer(const char *buf, size_t s) +{ + volatile const char *p; + size_t page_size; + + page_size = sysconf(_SC_PAGESIZE); + for (p = buf; p buf + s; + p += page_size - ((uintptr_t)p page_size - 1)) + *p; +} + +/* * Wrapper for archive_write_data(). */ static void write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s) { + prefault_buffer(buf, s); if (archive_write_data(a, buf, s) != (ssize_t)s) bsdar_errc(bsdar, EX_SOFTWARE, 0, %s, archive_error_string(a)); ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 31 lines] D2887: Allow ELF Tool Chain elfcopy to be installed as objcopy
emaste created this revision. emaste added a reviewer: andrew. emaste added a subscriber: freebsd-toolchain-list. Herald added subscribers: emaste, bdrewery. REVISION SUMMARY ELF Tool Chain elfcopy is nearly a drop-in replacement for GNU objcopy (but does not currently support PE output, needed for building x86 UEFI bits). Add a make.conf knob to allow installing it as objcopy and set it by default for aarch64 only, where we don't have a native binutils. This is WIP for comment and testing. REVISION DETAIL https://reviews.freebsd.org/D2887 AFFECTED FILES gnu/usr.bin/binutils/Makefile share/mk/src.opts.mk tools/build/mk/OptionalObsoleteFiles.inc tools/build/options/WITH_ELFCOPY_AS_OBJCOPY usr.bin/elfcopy/Makefile EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, andrew Cc: bdrewery, freebsd-toolchain-list, emaste diff --git a/usr.bin/elfcopy/Makefile b/usr.bin/elfcopy/Makefile --- a/usr.bin/elfcopy/Makefile +++ b/usr.bin/elfcopy/Makefile @@ -7,7 +7,15 @@ .PATH: ${ELFCOPYDIR} +.if ${MK_ELFCOPY_AS_OBJCOPY} != no +PROG= objcopy +objcopy.1: elfcopy.1 + sed -e 's/\.Dt ELFCOPY 1/.Dt OBJCOPY 1/' \ + -e 's/\.Nm elfcopy/.Nm objcopy/' ${.ALLSRC} ${.TARGET} +CLEANFILES+= objcopy.1 +.else PROG= elfcopy +.endif SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c @@ -17,8 +25,8 @@ CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common -MAN= elfcopy.1 strip.1 +MAN= ${PROG}.1 strip.1 -LINKS= ${BINDIR}/elfcopy ${BINDIR}/strip +LINKS= ${BINDIR}/${PROG} ${BINDIR}/strip .include bsd.prog.mk diff --git a/tools/build/options/WITH_ELFCOPY_AS_OBJCOPY b/tools/build/options/WITH_ELFCOPY_AS_OBJCOPY new file mode 100644 --- /dev/null +++ b/tools/build/options/WITH_ELFCOPY_AS_OBJCOPY @@ -0,0 +1,4 @@ +.\ $FreeBSD$ +Set to build and install ELF Tool Chain's elfcopy as +.Xr objcopy 1 , +instead of the one from GNU Binutils. diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -184,7 +184,9 @@ .if ${MK_BINUTILS} == no OLD_FILES+=usr/bin/as OLD_FILES+=usr/bin/ld +.if ${MK_ELFTOOLCHAIN_TOOLS} != no ${MK_ELFCOPY_AS_OBJCOPY} == no OLD_FILES+=usr/bin/objcopy +.endif OLD_FILES+=usr/bin/objdump OLD_FILES+=usr/bin/readelf OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.x @@ -202,7 +204,9 @@ OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xw OLD_FILES+=usr/share/man/man1/as.1.gz OLD_FILES+=usr/share/man/man1/ld.1.gz +.if ${MK_ELFTOOLCHAIN_TOOLS} != no ${MK_ELFCOPY_AS_OBJCOPY} == no OLD_FILES+=usr/share/man/man1/objcopy.1.gz +.endif OLD_FILES+=usr/share/man/man1/objdump.1.gz OLD_FILES+=usr/share/man/man1/readelf.1.gz OLD_FILES+=usr/share/man/man7/as.7.gz @@ -1648,7 +1652,8 @@ OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee.cat .endif -.if ${MK_ELFTOOLCHAIN_TOOLS} == no +.if ${MK_ELFTOOLCHAIN_TOOLS} == no || \ +(${MK_ELFTOOLCHAIN_TOOLS} != no MK_ELFCOPY_AS_OBJCOPY == no) OLD_FILES+=usr/bin/elfcopy OLD_FILES+=usr/share/man/man1/elfcopy.1.gz .endif diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -234,6 +234,9 @@ .endif .if ${__T} == aarch64 BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB +__DEFAULT_YES_OPTIONS+=ELFCOPY_AS_OBJCOPY +.else +__DEFAULT_NO_OPTIONS+=ELFCOPY_AS_OBJCOPY .endif # LLVM lacks support for FreeBSD 64-bit atomic operations for ARMv4/ARMv5 .if ${__T} == arm || ${__T} == armeb diff --git a/gnu/usr.bin/binutils/Makefile b/gnu/usr.bin/binutils/Makefile --- a/gnu/usr.bin/binutils/Makefile +++ b/gnu/usr.bin/binutils/Makefile @@ -11,7 +11,7 @@ as \ ld \ ${_nm} \ - objcopy \ + ${_objcopy} \ objdump \ ${_readelf} \ ${_size} \ @@ -26,5 +26,8 @@ _strings= strings _strip= strip .endif +.if ${MK_ELFTOOLCHAIN_TOOLS} == no || ${MK_ELFCOPY_AS_OBJCOPY} == no +_objcopy= objcopy +.endif .include bsd.subdir.mk ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D2887: Allow ELF Tool Chain elfcopy to be installed as objcopy
emaste added a comment. In https://reviews.freebsd.org/D2887#56056, @bapt wrote: Why not always build elfcopy and just make a hardlink objcopy if MK_ELFCOPY_AS_OBJCOPY is set? That will make elfcopy always available to users That's a possibility, although I think I'd prefer to (eventually) just install elfcopy as objcopy on all platforms, ensuring that it supports all of the options we care about. We haven't yet shipped elfcopy in a release. REVISION DETAIL https://reviews.freebsd.org/D2887 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, andrew Cc: bapt, bdrewery, freebsd-toolchain-list, emaste ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Accepted] D1932: Remove the non-standard CC alias for c++
emaste accepted this revision. REPOSITORY rS FreeBSD src repository BRANCH /head REVISION DETAIL https://reviews.freebsd.org/D1932 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: dim, theraven, emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D1932: Remove the non-standard CC alias for c++
emaste added a comment. In https://reviews.freebsd.org/D1932#49686, @imp wrote: it is a very de-facto standard that many ports rely on. Many ports will choose CC if it exists, but I'm not sure they rely on it. Autoconf and cmake builds will try a list and if they pick c++ next they'll be fine. exp-run requested in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200475 REPOSITORY rS FreeBSD src repository REVISION DETAIL https://reviews.freebsd.org/D1932 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: dim, emaste, theraven, imp Cc: imp, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D2576: Update crunch bootstrapping test
This revision was automatically updated to reflect the committed changes. Closed by commit rS283108: Update crunch bootstrapping test for recent fixes (authored by emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D2576?vs=5456id=5476#toc REPOSITORY rS FreeBSD src repository REVISION DETAIL https://reviews.freebsd.org/D2576 AFFECTED FILES head/Makefile.inc1 CHANGE DETAILS diff --git a/head/Makefile.inc1 b/head/Makefile.inc1 --- a/head/Makefile.inc1 +++ b/head/Makefile.inc1 @@ -1297,7 +1297,9 @@ _lex=usr.bin/lex .endif -.if ${BOOTSTRAPPING} 1001507 +# r277259 crunchide: Correct 64-bit section header offset +# r281674 crunchide: always include both 32- and 64-bit ELF support +.if ${BOOTSTRAPPING} 1100071 _crunch= usr.sbin/crunch .endif @@ -1466,11 +1468,6 @@ _btxld= usr.sbin/btxld .endif .endif -.if ${TARGET_ARCH} != ${MACHINE_ARCH} -.if ${MK_RESCUE} != no -_crunchide= usr.sbin/crunch/crunchide -.endif -.endif # If we're given an XAS, don't build binutils. .if ${XAS:M/*} == EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, imp Cc: freebsd-toolchain diff --git a/head/Makefile.inc1 b/head/Makefile.inc1 --- a/head/Makefile.inc1 +++ b/head/Makefile.inc1 @@ -1297,7 +1297,9 @@ _lex= usr.bin/lex .endif -.if ${BOOTSTRAPPING} 1001507 +# r277259 crunchide: Correct 64-bit section header offset +# r281674 crunchide: always include both 32- and 64-bit ELF support +.if ${BOOTSTRAPPING} 1100071 _crunch= usr.sbin/crunch .endif @@ -1466,11 +1468,6 @@ _btxld= usr.sbin/btxld .endif .endif -.if ${TARGET_ARCH} != ${MACHINE_ARCH} -.if ${MK_RESCUE} != no -_crunchide= usr.sbin/crunch/crunchide -.endif -.endif # If we're given an XAS, don't build binutils. .if ${XAS:M/*} == ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 9 lines] D2576: Update crunch bootstrapping test
emaste created this revision. emaste added a reviewer: imp. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY - r277259 crunchide: Correct 64-bit section header offset - r281674 crunchide: always include both 32- and 64-bit ELF support With built-in cross-size support we also no longer need a special case for cross-build crunchide. REVISION DETAIL https://reviews.freebsd.org/D2576 AFFECTED FILES Makefile.inc1 CHANGE DETAILS diff --git a/Makefile.inc1 b/Makefile.inc1 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1297,7 +1297,9 @@ _lex=usr.bin/lex .endif -.if ${BOOTSTRAPPING} 1001507 +# r277259 crunchide: Correct 64-bit section header offset +# r281674 crunchide: always include both 32- and 64-bit ELF support +.if ${BOOTSTRAPPING} 1100071 _crunch= usr.sbin/crunch .endif @@ -1466,11 +1468,6 @@ _btxld= usr.sbin/btxld .endif .endif -.if ${TARGET_ARCH} != ${MACHINE_ARCH} -.if ${MK_RESCUE} != no -_crunchide= usr.sbin/crunch/crunchide -.endif -.endif # If we're given an XAS, don't build binutils. .if ${XAS:M/*} == EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, imp Cc: freebsd-toolchain diff --git a/Makefile.inc1 b/Makefile.inc1 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1297,7 +1297,9 @@ _lex= usr.bin/lex .endif -.if ${BOOTSTRAPPING} 1001507 +# r277259 crunchide: Correct 64-bit section header offset +# r281674 crunchide: always include both 32- and 64-bit ELF support +.if ${BOOTSTRAPPING} 1100071 _crunch= usr.sbin/crunch .endif @@ -1466,11 +1468,6 @@ _btxld= usr.sbin/btxld .endif .endif -.if ${TARGET_ARCH} != ${MACHINE_ARCH} -.if ${MK_RESCUE} != no -_crunchide= usr.sbin/crunch/crunchide -.endif -.endif # If we're given an XAS, don't build binutils. .if ${XAS:M/*} == ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 19 lines] D2408: Add ELF Tool Chain's c++filt to the build
emaste created this revision. emaste added a reviewer: brooks. emaste added a subscriber: freebsd-toolchain. REVISION DETAIL https://reviews.freebsd.org/D2408 AFFECTED FILES usr.bin/Makefile usr.bin/cxxfilt/Makefile CHANGE DETAILS diff --git a/usr.bin/cxxfilt/Makefile b/usr.bin/cxxfilt/Makefile new file mode 100644 --- /dev/null +++ b/usr.bin/cxxfilt/Makefile @@ -0,0 +1,17 @@ +# $FreeBSD$ + +.include src.opts.mk + +ELFTCDIR=${.CURDIR}/../../contrib/elftoolchain +SRCDIR= ${ELFTCDIR}/cxxfilt + +.PATH: ${SRCDIR} + +PROG=c++filt +SRCS=cxxfilt.c + +LIBADD= elftc + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include bsd.prog.mk diff --git a/usr.bin/Makefile b/usr.bin/Makefile --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -36,6 +36,7 @@ csplit \ ctlstat \ cut \ + ${_cxxfilt} \ demandoc \ dirname \ dpv \ @@ -237,6 +238,7 @@ .if ${MK_ELFTOOLCHAIN_TOOLS} != no _addr2line= addr2line +_cxxfilt=cxxfilt _elfcopy=elfcopy _nm= nm _readelf=readelf EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, brooks Cc: freebsd-toolchain diff --git a/usr.bin/cxxfilt/Makefile b/usr.bin/cxxfilt/Makefile new file mode 100644 --- /dev/null +++ b/usr.bin/cxxfilt/Makefile @@ -0,0 +1,17 @@ +# $FreeBSD$ + +.include src.opts.mk + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +SRCDIR= ${ELFTCDIR}/cxxfilt + +.PATH: ${SRCDIR} + +PROG= c++filt +SRCS= cxxfilt.c + +LIBADD= elftc + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include bsd.prog.mk diff --git a/usr.bin/Makefile b/usr.bin/Makefile --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -36,6 +36,7 @@ csplit \ ctlstat \ cut \ + ${_cxxfilt} \ demandoc \ dirname \ dpv \ @@ -237,6 +238,7 @@ .if ${MK_ELFTOOLCHAIN_TOOLS} != no _addr2line= addr2line +_cxxfilt= cxxfilt _elfcopy= elfcopy _nm= nm _readelf= readelf ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D2408: Add ELF Tool Chain's c++filt to the build
emaste added a comment. Oh - we also need either: diff --git a/gnu/usr.bin/cc/Makefile b/gnu/usr.bin/cc/Makefile index abc9876..12ee7f8 100644 --- a/gnu/usr.bin/cc/Makefile +++ b/gnu/usr.bin/cc/Makefile @@ -12,7 +12,10 @@ SUBDIR+= cpp .endif .if ${MK_CXX} != no -SUBDIR+= cc1plus c++ c++filt +SUBDIR+= cc1plus c++ +.if ${MK_ELFTOOLCHAIN_TOLOLS} != no +SUBDIR+= c++filt +.endif .endif .if ${MK_GCOV} != no or --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -238,7 +238,9 @@ SUBDIR+=ee .if ${MK_ELFTOOLCHAIN_TOOLS} != no _addr2line=addr2line +.if ${MK_GCC} != no ${MK_CXX} != no _cxxfilt= cxxfilt +.endif _elfcopy= elfcopy _nm= nm _readelf= readelf REVISION DETAIL https://reviews.freebsd.org/D2408 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, brooks Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D2408: Add ELF Tool Chain's c++filt to the build
This revision was automatically updated to reflect the committed changes. Closed by commit rS282285: Add ELF Tool Chain's c++filt to the build (authored by emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D2408?vs=5108id=5123#toc REPOSITORY rS FreeBSD src repository REVISION DETAIL https://reviews.freebsd.org/D2408 AFFECTED FILES head/gnu/usr.bin/cc/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/Makefile CHANGE DETAILS diff --git a/head/tools/build/mk/OptionalObsoleteFiles.inc b/head/tools/build/mk/OptionalObsoleteFiles.inc --- a/head/tools/build/mk/OptionalObsoleteFiles.inc +++ b/head/tools/build/mk/OptionalObsoleteFiles.inc @@ -1004,7 +1004,9 @@ .if ${MK_CXX} == no OLD_FILES+=usr/bin/CC OLD_FILES+=usr/bin/c++ +.if ${MK_ELFTOOLCHAIN_TOOLS} == no OLD_FILES+=usr/bin/c++filt +.endif OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus .if ${MK_GCC} == no diff --git a/head/gnu/usr.bin/cc/Makefile b/head/gnu/usr.bin/cc/Makefile --- a/head/gnu/usr.bin/cc/Makefile +++ b/head/gnu/usr.bin/cc/Makefile @@ -12,7 +12,10 @@ .endif .if ${MK_CXX} != no -SUBDIR+= cc1plus c++ c++filt +SUBDIR+= cc1plus c++ +.if ${MK_ELFTOOLCHAIN_TOOLS} == no +SUBDIR+= c++filt +.endif .endif .if ${MK_GCOV} != no diff --git a/head/usr.bin/Makefile b/head/usr.bin/Makefile --- a/head/usr.bin/Makefile +++ b/head/usr.bin/Makefile @@ -36,6 +36,7 @@ csplit \ ctlstat \ cut \ + ${_cxxfilt} \ demandoc \ dirname \ dpv \ @@ -237,6 +238,7 @@ .if ${MK_ELFTOOLCHAIN_TOOLS} != no _addr2line= addr2line +_cxxfilt=cxxfilt _elfcopy=elfcopy _nm= nm _readelf=readelf EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, brooks, imp Cc: imp, freebsd-toolchain diff --git a/head/tools/build/mk/OptionalObsoleteFiles.inc b/head/tools/build/mk/OptionalObsoleteFiles.inc --- a/head/tools/build/mk/OptionalObsoleteFiles.inc +++ b/head/tools/build/mk/OptionalObsoleteFiles.inc @@ -1004,7 +1004,9 @@ .if ${MK_CXX} == no OLD_FILES+=usr/bin/CC OLD_FILES+=usr/bin/c++ +.if ${MK_ELFTOOLCHAIN_TOOLS} == no OLD_FILES+=usr/bin/c++filt +.endif OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus .if ${MK_GCC} == no diff --git a/head/gnu/usr.bin/cc/Makefile b/head/gnu/usr.bin/cc/Makefile --- a/head/gnu/usr.bin/cc/Makefile +++ b/head/gnu/usr.bin/cc/Makefile @@ -12,7 +12,10 @@ .endif .if ${MK_CXX} != no -SUBDIR+= cc1plus c++ c++filt +SUBDIR+= cc1plus c++ +.if ${MK_ELFTOOLCHAIN_TOOLS} == no +SUBDIR+= c++filt +.endif .endif .if ${MK_GCOV} != no diff --git a/head/usr.bin/Makefile b/head/usr.bin/Makefile --- a/head/usr.bin/Makefile +++ b/head/usr.bin/Makefile @@ -36,6 +36,7 @@ csplit \ ctlstat \ cut \ + ${_cxxfilt} \ demandoc \ dirname \ dpv \ @@ -237,6 +238,7 @@ .if ${MK_ELFTOOLCHAIN_TOOLS} != no _addr2line= addr2line +_cxxfilt= cxxfilt _elfcopy= elfcopy _nm= nm _readelf= readelf ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D2408: Add ELF Tool Chain's c++filt to the build
emaste added inline comments. INLINE COMMENTS gnu/usr.bin/cc/Makefile:16 Sigh, this is backwards. Will update to `== no` - i.e., build GCC's c++filt in the `WITHOUT_ELFTOOLCHAIN_TOOLS` case. REVISION DETAIL https://reviews.freebsd.org/D2408 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: emaste, brooks Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 32 lines] D2338: readelf: avoid division by zero for files with invalid sh_entsize
emaste created this revision. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY Variations reported in: https://sourceforge.net/p/elftoolchain/tickets/439 https://sourceforge.net/p/elftoolchain/tickets/444 https://sourceforge.net/p/elftoolchain/tickets/445 https://sourceforge.net/p/elftoolchain/tickets/467 REVISION DETAIL https://reviews.freebsd.org/D2338 AFFECTED FILES readelf/readelf.c To: emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D2305: Fix bootstraping of crunchide
emaste added inline comments. INLINE COMMENTS Makefile.inc1:1469 I believe @imp suggested we still need it unconditionally when crossbuilding, and also note that usr.sbin/crunch is added for `${BOOTSTRAPPING} 114` in bootstrap-tools. I wonder if we can just promote usr.sbin/crunch to an unconditional build tool? REVISION DETAIL https://reviews.freebsd.org/D2305 To: rodrigc, emaste, imp Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated] D2305: Fix bootstraping of crunchide
emaste added a comment. ! In D2305#4, @emaste wrote: I believe @imp suggested we still need it unconditionally when crossbuilding, and also note that usr.sbin/crunch is added for `${BOOTSTRAPPING} 114` in bootstrap-tools. I wonder if we can just promote usr.sbin/crunch to an unconditional build tool? Indeed, crunchide is built with only 32- or 64-bit ELF support depending on the target. I'll see about always compiling in both instead. If that works we can drop this part and change the `${BOOTSTRAPPING}` test below. Or just make it unconditional below. REVISION DETAIL https://reviews.freebsd.org/D2305 To: rodrigc, imp, emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 13 lines] D2317: readelf: Validate MIPS option header
emaste created this revision. emaste added a reviewer: imp. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY Reported by antiAgainst in ELF Tool Chain ticket 442 https://sourceforge.net/p/elftoolchain/tickets/442/ REVISION DETAIL https://reviews.freebsd.org/D2317 AFFECTED FILES readelf/readelf.c To: emaste, imp Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Requested Changes To] D2305: Fix bootstraping of crunchide
emaste requested changes to this revision. emaste added a comment. This revision now requires changes to proceed. `_crunchide` here is still needed for cross-builds (but should be addressed by D2314). `_crunch` in the context not provided in this diff is the one that needs to be updated I updated it in rS281659 REVISION DETAIL https://reviews.freebsd.org/D2305 To: rodrigc, imp, emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D2305: Fix bootstraping of crunchide
emaste added a comment. This review can be abandoned - the original issue is now fixed. We can open another review for a future change to make it unconditional. REVISION DETAIL https://reviews.freebsd.org/D2305 To: rodrigc, imp, emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D2317: readelf: Validate MIPS option header
emaste closed this revision. emaste added a comment. Committed here: https://sourceforge.net/p/elftoolchain/code/3187, will come into FreeBSD with the next ELF Tool Chain import REVISION DETAIL https://reviews.freebsd.org/D2317 To: emaste, imp Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D2302: Add arm64 to universe if binutils is available
emaste added a comment. ! In D2302#4, @andrew wrote: Would it be difficult to have a warning if the package is not installed? Perhaps ``` .else @echo arm64 skipped - install aarch64-binutils port or package to build ``` REVISION DETAIL https://reviews.freebsd.org/D2302 To: emaste, imp, andrew Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 6 lines] D2302: Add arm64 to universe if binutils is available
emaste created this revision. emaste added reviewers: imp, andrew. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY arm64 relies on an external binutils port or package because the in-tree linker from binutils 2.17.50 does not support arm64. Add arm64 to universe if the linker is available. buildworld and buildkernel use the external binutils automatically, so `pkg install aarch64-binutils` is sufficient for building FreeBSD/arm64. REVISION DETAIL https://reviews.freebsd.org/D2302 AFFECTED FILES Makefile To: emaste, imp, andrew Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D2302: Add arm64 to universe if binutils is available
emaste added inline comments. INLINE COMMENTS Makefile:383 Also add ``` universe_epilogue: universe_arm64_skip ``` REVISION DETAIL https://reviews.freebsd.org/D2302 To: emaste, imp, andrew Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated, 10 lines] D2302: Add arm64 to universe if binutils is available
emaste updated this revision to Diff 4849. emaste added a comment. Add a message if we skip arm64 because we don't have binutils CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D2302?vs=4846id=4849 REVISION DETAIL https://reviews.freebsd.org/D2302 AFFECTED FILES Makefile To: emaste, imp, andrew Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D2302: Add arm64 to universe if binutils is available
emaste closed this revision. emaste updated this revision to Diff 4865. emaste added a comment. Closed by commit rS281629 (authored by @emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D2302?vs=4849id=4865#toc REVISION DETAIL https://reviews.freebsd.org/D2302 AFFECTED FILES head/Makefile To: emaste, imp, andrew Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Changed Subscribers] D2285: gcc 4.9.1 compilation fixes for aesni
emaste added a subscriber: emaste. REVISION DETAIL https://reviews.freebsd.org/D2285 To: rodrigc, jmg Cc: emaste, dim, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Accepted] D2187: Ensure cross assembler, linker and objcopy are used for the build32 stage
emaste accepted this revision. emaste added a comment. This revision is now accepted and ready to land. LGTM BRANCH /head REVISION DETAIL https://reviews.freebsd.org/D2187 To: dim, rodrigc, imp, bapt, emaste Cc: emaste, imp, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 5 lines] D2156: Switch to ELF toolchain readelf
emaste created this revision. emaste added a reviewer: imp. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY ELF toolchain readelf lacked some functionality at the time other tools (like size, strip, nm, etc.) were switched over to the ELF toolchain versions. This has been addressed as of the latest update, so we should be able to use it as well. TEST PLAN - Ports exp-run - ad-hoc comparison of output against in-tree binutils readelf REVISION DETAIL https://reviews.freebsd.org/D2156 AFFECTED FILES gnu/usr.bin/binutils/Makefile usr.bin/Makefile To: emaste, imp Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D2156: Switch to ELF toolchain readelf
emaste added a comment. exp-run is here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198950 REVISION DETAIL https://reviews.freebsd.org/D2156 To: emaste, imp, bapt Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 11 lines] D2003: Do not strip crunched binary; it will be done by install
emaste created this revision. emaste added reviewers: andrew, imp. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY In cross-build cases it is possible we won't have a cross-strip during the the rescue build. Binaries are already stripped on install anyhow, so there is no need to strip during the build. REVISION DETAIL https://reviews.freebsd.org/D2003 AFFECTED FILES Makefile.inc1 sys/sys/param.h usr.sbin/crunch/crunchgen/crunchgen.c To: emaste, andrew, imp Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D1974: Support out-of-tree binutils with in-tree compiler
emaste added a comment. This supports aarch64 builds by installing the aarch64-binutils port and adding `CROSS_BINUTILS_PREFIX=/usr/local/aarch64-freebsd/bin/` to the make command line. REVISION DETAIL https://reviews.freebsd.org/D1974 To: emaste, bapt Cc: andrew, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Changed Subscribers] D1974: Support out-of-tree binutils with in-tree compiler
emaste added a subscriber: andrew. REVISION DETAIL https://reviews.freebsd.org/D1974 To: emaste, bapt Cc: andrew, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D1974: Support out-of-tree binutils with in-tree compiler
emaste closed this revision. emaste updated this revision to Diff 3999. emaste added a comment. Closed by commit rS279328 (authored by @emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D1974?vs=3998id=3999#toc REVISION DETAIL https://reviews.freebsd.org/D1974 AFFECTED FILES head/Makefile.inc1 To: emaste, bapt, imp Cc: imp, andrew, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 6 lines] D1974: Support out-of-tree binutils with in-tree compiler
emaste created this revision. emaste added a reviewer: bapt. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY Right now `CROSS_BINUTILS_PATH` is honoured only when `XCC` is set, i.e. an out-of-tree compiler. Allow `CROSS_BINUTILS_PATH` to pass through to a -B option also when using the in-tree compiler. I think this could be named just `BINUTILS_PATH`, but the existing `CROSS_BINUTILS_PATH` could as well. Since they have the same meaning I used the existing, if somewhat confusing, name. REVISION DETAIL https://reviews.freebsd.org/D1974 AFFECTED FILES Makefile.inc1 To: emaste, bapt Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D1826: libdwarf: Add symbol value when processing .rela relocations
emaste added a comment. See also D1819 REVISION DETAIL https://reviews.freebsd.org/D1826 To: emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated] D1819: libdwarf: Handle .rel relocations
emaste added a reviewer: br. REVISION DETAIL https://reviews.freebsd.org/D1819 To: emaste, gnn, rpaulo, br Cc: rpaulo, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated] D1826: libdwarf: Add symbol value when processing .rela relocations
emaste added reviewers: kostikbel, rpaulo. REVISION DETAIL https://reviews.freebsd.org/D1826 To: emaste, kostikbel, rpaulo Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 6 lines] D1826: libdwarf: Add symbol value when processing .rela relocations
emaste created this revision. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY In practice .rela debug relocations often use the the .debug_* sections as the symbol, which has the value 0: ``` Relocation section '.rela.debug_info' at offset 0xd18 contains 205 entries: Offset Info Type Sym. ValueSym. Name + Addend 0006 001a000a R_X86_64_32 .debug_abbrev + 0 000c 001e000a R_X86_64_32 .debug_str + 0 0012 001e000a R_X86_64_32 .debug_str + 45 ``` so in those cases there is no difference if the symbol value is used in the relocation or not. It is not always the case though: ``` 0039 00270001 R_X86_64_64 0010 xen_pci_driver + 0 ``` REVISION DETAIL https://reviews.freebsd.org/D1826 AFFECTED FILES libdwarf/libdwarf_elf_init.c To: emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 55 lines] D1819: libdwarf: Handle .rel relocations
emaste created this revision. emaste added a reviewer: gnn. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY Some architectures have .rel relocations for debug data, so handle it in addition to .rela. Issue discovered from ctfconvert on un-linked ARM object files. REVISION DETAIL https://reviews.freebsd.org/D1819 AFFECTED FILES libdwarf/_libdwarf.h libdwarf/dwarf_reloc.c libdwarf/dwarf_set_reloc_application.3 libdwarf/libdwarf.c libdwarf/libdwarf_elf_init.c To: emaste, gnn Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D1682: Preserve hard symbolic links when modifying source file
emaste closed this revision. emaste updated this revision to Diff 3500. emaste added a comment. Closed by commit rS277843 (authored by @emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D1682?vs=3447id=3500#toc REVISION DETAIL https://reviews.freebsd.org/D1682 AFFECTED FILES head/contrib/elftoolchain/elfcopy/main.c To: emaste, rpaulo, imp Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 54 lines] D1682: Preserve hard symbolic links when modifying source file
emaste created this revision. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY Strip is often used to modify existing files, rather than creating new files. If the existing file has hard links or is a symbolic link, act as if editing the file in place and preserve the links. Reported by: luigi (on FreeBSD-current) REVISION DETAIL https://reviews.freebsd.org/D1682 AFFECTED FILES contrib/elftoolchain/elfcopy/main.c To: emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated, 55 lines] D1663: elfcopy: Select mode by the end of the program name
emaste retitled this revision from elfcopy: Consider program name to start after last - to elfcopy: Select mode by the end of the program name. emaste updated the summary for this revision. emaste updated this revision to Diff 3418. emaste added a comment. Output a warning if the program name (argv[0]) does not match any of the expected ones. CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D1663?vs=3417id=3418 REVISION DETAIL https://reviews.freebsd.org/D1663 AFFECTED FILES elfcopy/main.c test/elfcopy/func.sh test/elfcopy/tc/strip-basename-1/strip-basename-1.sh To: emaste, dim Cc: dim, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated, 49 lines] D1663: elfcopy: Consider program name to start after last -
emaste updated this revision to Diff 3417. emaste added a comment. This revision now requires review to proceed. Just compare the end of the program name with strip/mcs rather than looking for a dash. This is the way it's done in FreeBSD ar/ranlib already, and allows names like bsdstrip. Also add a test case. CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D1663?vs=3416id=3417 REVISION DETAIL https://reviews.freebsd.org/D1663 AFFECTED FILES elfcopy/main.c test/elfcopy/func.sh test/elfcopy/tc/strip-basename-1/strip-basename-1.sh To: emaste, dim Cc: dim, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 3 lines] D1543: crunchide: Correct 64-bit section header offset
emaste created this revision. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY For 64-bit binaries the Elf_Ehdr e_shoff is at offset 40, not 44. Instead of using an incorrect hardcoded offset, let the compiler figure it out for us with offsetof(). REVISION DETAIL https://reviews.freebsd.org/D1543 AFFECTED FILES usr.sbin/crunch/crunchide/exec_elf32.c To: emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated] D1543: crunchide: Correct 64-bit section header offset
emaste added a reviewer: pfg. REVISION DETAIL https://reviews.freebsd.org/D1543 To: emaste, pfg Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D1543: crunchide: Correct 64-bit section header offset
emaste closed this revision. emaste added a comment. Committed as rS277259 REVISION DETAIL https://reviews.freebsd.org/D1543 To: emaste, pfg, imp Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 5 lines] D1516: Update aarch64 patch for binutils 2.25
emaste created this revision. emaste added reviewers: bapt, andrew. emaste added a subscriber: freebsd-toolchain. REVISION DETAIL https://reviews.freebsd.org/D1516 AFFECTED FILES devel/aarch64-binutils/Makefile devel/binutils/files/patch-aarch64.diff To: emaste, bapt, andrew Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D1516: Update aarch64 patch for binutils 2.25
emaste closed this revision. emaste updated this revision to Diff 3160. emaste added a comment. Closed by commit rP376986 (authored by @emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D1516?vs=3147id=3160#toc REVISION DETAIL https://reviews.freebsd.org/D1516 AFFECTED FILES head/devel/aarch64-binutils/Makefile head/devel/binutils/files/patch-aarch64.diff To: emaste, bapt, andrew Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 10 lines] D1524: ar: Disallow directory traversal
emaste created this revision. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY Set ARCHIVE_EXTRACT_SECURE_SYMLINKS and ARCHIVE_EXTRACT_SECURE_NODOTDOT as in bsdtar to prevent extraction of archive entries whose pathnames contain .. or whose target directory would be altered by a symlink. Also disallow absolute pathnames. We don't currently provide an option to disable this behaviour (as bsdtar's -P does). It is unlikely to be a problem in practice for ar(1), but the -P option is available if we want to allow it. Reported by: Alexander Cherepanov chere...@mccme.ru Elftoolchain ticket: 474 TEST PLAN From https://sourceforge.net/p/elftoolchain/tickets/474/ ~~~ printf '!arch\n%-48s%-10s`\n%-48s%-10s`\n' /tmp/file 0 ../file 0 test.a n% ./ar -xv test.a x - /tmp/file ar: warning: Absolute path '/tmp/file' x - ../file ar: warning: Path contains '..' ~~~ REVISION DETAIL https://reviews.freebsd.org/D1524 AFFECTED FILES usr.bin/ar/read.c To: emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated] D1505: Enable building libclang_rt (asan, ubsan and profile) for selected arches
emaste added a comment. Apart from the bit of ugliness in lib/Makefile Perhaps the ugliness needs a comment, at least. Also a BSD.debug.mk entry for `WITH_DEBUG_FILES=yes`? REVISION DETAIL https://reviews.freebsd.org/D1505 To: dim, andrew, bapt, imp, emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D1505: Enable building libclang_rt (asan, ubsan and profile) for selected arches
emaste added a comment. Note that I also did not introduce yet another WITH_LIBCLANG_RT knob, This is fine in my opinion; we don't need another knob. REVISION DETAIL https://reviews.freebsd.org/D1505 To: dim, andrew, bapt, imp, emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Changed Subscribers] D1468: Fix the ARM build of compiler-rt
emaste added a subscriber: emaste. BRANCH /head REVISION DETAIL https://reviews.freebsd.org/D1468 To: andrew, loos, sbruno, rpaulo, ian, dim, imp Cc: emaste, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D1446: Add the AArch64 llvm backend
emaste added a comment. ! In D1446#10, @andrew wrote: We will also need llvm r92 to build the kernel without using floating point registers. Can we bring this one directly into HEAD? BRANCH /head REVISION DETAIL https://reviews.freebsd.org/D1446 To: andrew, emaste, dim Cc: freebsd-toolchain, emaste ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D1446: Add the AArch64 llvm backend
emaste added a comment. I imported this change then merged to my arm64 branch and it looks fine to me. REVISION DETAIL https://reviews.freebsd.org/D1446 To: dim, andrew, emaste Cc: freebsd-toolchain, emaste ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Changed Subscribers] D1446: Add the AArch64 llvm backend
emaste added a subscriber: freebsd-toolchain. REVISION DETAIL https://reviews.freebsd.org/D1446 To: andrew, emaste, dim Cc: freebsd-toolchain, emaste ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Accepted] D1446: Add the AArch64 llvm backend
emaste accepted this revision. This revision is now accepted and ready to land. BRANCH /head INLINE COMMENTS lib/clang/include/AArch64GenAsmMatcher.inc:1 Please unexpand these before checkin. SVN does the expansion on checkout. I'm not sure if they're collapsed on checkin, or stored verbatim, but don't want to find out :-) REVISION DETAIL https://reviews.freebsd.org/D1446 To: andrew, dim, emaste Cc: freebsd-toolchain, emaste ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D1428: readelf: Handle note types from different operating systems
emaste closed this revision. emaste updated this revision to Diff 3002. emaste added a comment. Closed by commit rS276705 (authored by @emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D1428?vs=2980id=3002#toc REVISION DETAIL https://reviews.freebsd.org/D1428 AFFECTED FILES head/contrib/elftoolchain/readelf/readelf.c To: emaste, kostikbel Cc: rpaulo, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Request, 191 lines] D1428: readelf: Handle note types from different operating systems
emaste created this revision. emaste added a subscriber: freebsd-toolchain. REVISION SUMMARY Previously elftoolchain readelf(1) only displayed correct names for Linux note types. Upstream elftoolchain ticket #473 https://sourceforge.net/p/elftoolchain/tickets/473/ REVISION DETAIL https://reviews.freebsd.org/D1428 AFFECTED FILES readelf/readelf.c To: emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Commented On] D1428: readelf: Handle note types from different operating systems
emaste added a comment. ! In D1428#3, @rpaulo wrote: This looks odd. Why are we relying on magic numbers instead of constants/enums like before? Some of the constants in the previous version are Linux-specific, and don't exist in our ELF headers. We could make up our own constants (e.g. NT_LINUX_AUXV) but it doesn't seem like that would provide much value. The same constant name may have different values on different OSes. REVISION DETAIL https://reviews.freebsd.org/D1428 To: emaste Cc: rpaulo, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D1341: Set up default shstrtab entries at initialization
emaste closed this revision. emaste updated this revision to Diff 2813. emaste added a comment. Closed by commit rS276061 (authored by @emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D1341?vs=2791id=2813#toc REVISION DETAIL https://reviews.freebsd.org/D1341 AFFECTED FILES head/contrib/elftoolchain/elfcopy/sections.c To: emaste, imp Cc: imp, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Updated] D1341: Set up default shstrtab entries at initialization
emaste updated the test plan for this revision. REVISION DETAIL https://reviews.freebsd.org/D1341 To: emaste Cc: freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org
[Differential] [Closed] D1327: Do not strip all when stripping an explicit symbol
emaste closed this revision. emaste updated this revision to Diff 2778. emaste added a comment. Closed by commit rS275862 (authored by @emaste). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D1327?vs=2767id=2778#toc REVISION DETAIL https://reviews.freebsd.org/D1327 AFFECTED FILES head/contrib/elftoolchain/elfcopy/main.c To: emaste, imp Cc: imp, freebsd-toolchain ___ freebsd-toolchain@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to freebsd-toolchain-unsubscr...@freebsd.org