mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
crunchgen: fix "keep" for an ELF world, break it out
"keep" currently adds a leading underscore, which hasn't been useful or
accurate since a.out days. Preserve the symbol name as it's given
rather than mangle it to match ELF-style symbol names.
This was partially fixed back in
6cd35234a0
("Assume ELF-style symbol names now.") for crunchgen, but
the keeplist wasn't changed to match it.
While we're here, break it out to bsd.crunchgen.mk for later use in
bsdbox.
Reviewed by: adrian, imp
Differential Revision: https://reviews.freebsd.org/D42499
This commit is contained in:
parent
f0fa40867d
commit
8f2848eafa
|
@ -18,6 +18,7 @@
|
||||||
# CRUNCH_SRCDIR_${P}: base source directory for program ${P}
|
# CRUNCH_SRCDIR_${P}: base source directory for program ${P}
|
||||||
# CRUNCH_BUILDOPTS_${P}: additional build options for ${P}
|
# CRUNCH_BUILDOPTS_${P}: additional build options for ${P}
|
||||||
# CRUNCH_ALIAS_${P}: additional names to be used for ${P}
|
# CRUNCH_ALIAS_${P}: additional names to be used for ${P}
|
||||||
|
# CRUNCH_KEEP_${P}: additional symbols to keep for ${P}
|
||||||
#
|
#
|
||||||
# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P}
|
# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P}
|
||||||
# will be used to generate a hard link to the resulting binary.
|
# will be used to generate a hard link to the resulting binary.
|
||||||
|
@ -101,6 +102,9 @@ ${CONF}: Makefile
|
||||||
.ifdef CRUNCH_LIBS_${P}
|
.ifdef CRUNCH_LIBS_${P}
|
||||||
echo special ${P} lib ${CRUNCH_LIBS_${P}} >>${.TARGET}
|
echo special ${P} lib ${CRUNCH_LIBS_${P}} >>${.TARGET}
|
||||||
.endif
|
.endif
|
||||||
|
.ifdef CRUNCH_KEEP_${P}
|
||||||
|
echo special ${P} keep ${CRUNCH_KEEP_${P}} >>${.TARGET}
|
||||||
|
.endif
|
||||||
.for A in ${CRUNCH_ALIAS_${P}}
|
.for A in ${CRUNCH_ALIAS_${P}}
|
||||||
echo ln ${P} ${A} >>${.TARGET}
|
echo ln ${P} ${A} >>${.TARGET}
|
||||||
.endfor
|
.endfor
|
||||||
|
|
|
@ -1128,7 +1128,7 @@ prog_makefile_rules(FILE *outmk, prog_t *p)
|
||||||
fprintf(outmk, "\n");
|
fprintf(outmk, "\n");
|
||||||
fprintf(outmk, "\tcrunchide -k _crunched_%s_stub ", p->ident);
|
fprintf(outmk, "\tcrunchide -k _crunched_%s_stub ", p->ident);
|
||||||
for (lst = p->keeplist; lst != NULL; lst = lst->next)
|
for (lst = p->keeplist; lst != NULL; lst = lst->next)
|
||||||
fprintf(outmk, "-k _%s ", lst->str);
|
fprintf(outmk, "-k %s ", lst->str);
|
||||||
fprintf(outmk, "%s.lo\n", p->name);
|
fprintf(outmk, "%s.lo\n", p->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue