mirror of
git://sourceware.org/git/glibc.git
synced 2025-02-05 12:40:55 +08:00
2002-12-07 Roland McGrath <roland@redhat.com>
* Makerules ($(common-objpfx)format.lds): New target. (common-generated): Add it. ($(inst_libdir)/libc.so): Depend on that, and cat it into the result. * scripts/output-format.sed: New file. * Makefile (distribute): Add it.
This commit is contained in:
parent
99343c0579
commit
cc1b826866
3
Makefile
3
Makefile
@ -279,7 +279,8 @@ distribute := README README.libm INSTALL FAQ FAQ.in NOTES NEWS BUGS \
|
||||
mkinstalldirs move-if-change install-sh \
|
||||
test-installation.pl gen-FAQ.pl versions.awk\
|
||||
gen-sorted.awk abi-versions.awk abilist.awk \
|
||||
firstversions.awk documented.sh cpp)
|
||||
firstversions.awk documented.sh cpp \
|
||||
output-format.sed)
|
||||
|
||||
distribute := $(strip $(distribute))
|
||||
generated := $(generated) stubs.h
|
||||
|
18
Makerules
18
Makerules
@ -883,6 +883,20 @@ $(inst_slibdir)/libc-$(version).so: $(common-objpfx)libc.so $(+force)
|
||||
$(do-install-program)
|
||||
install: $(inst_slibdir)/libc.so$(libc.so-version)
|
||||
|
||||
# This fragment of linker script gives the OUTPUT_FORMAT statement
|
||||
# for the configuration we are building. We put this statement into
|
||||
# the linker scripts we install for -lc et al so that they will not be
|
||||
# used by a link for a different format on a multi-architecture system.
|
||||
$(common-objpfx)format.lds: $(..)scripts/output-format.sed \
|
||||
$(common-objpfx)config.make \
|
||||
$(common-objpfx)config.h $(..)Makerules
|
||||
$(LINK.o) -shared $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \
|
||||
-x c /dev/null -o $@.so -Wl,--verbose -v 2>&1 \
|
||||
| sed -n -f $< > $@.new
|
||||
rm -f $@.so
|
||||
mv -f $@.new $@
|
||||
common-generated += format.lds
|
||||
|
||||
ifndef subdir
|
||||
# What we install as libc.so for programs to link against is in fact a
|
||||
# link script. It contains references for the various libraries we need.
|
||||
@ -891,13 +905,15 @@ ifndef subdir
|
||||
# We need to use absolute paths since otherwise local copies (if they exist)
|
||||
# of the files are taken by the linker.
|
||||
install: $(inst_libdir)/libc.so
|
||||
$(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
|
||||
$(inst_libdir)/libc.so: $(common-objpfx)format.lds \
|
||||
$(common-objpfx)libc.so$(libc.so-version) \
|
||||
$(inst_libdir)/$(patsubst %,$(libtype.oS),\
|
||||
$(libprefix)$(libc-name)) \
|
||||
$(+force)
|
||||
(echo '/* GNU ld script';\
|
||||
echo ' Use the shared library, but some functions are only in';\
|
||||
echo ' the static library, so try that secondarily. */';\
|
||||
cat $<; \
|
||||
echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
|
||||
'$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
|
||||
')' \
|
||||
|
34
scripts/output-format.sed
Normal file
34
scripts/output-format.sed
Normal file
@ -0,0 +1,34 @@
|
||||
/ld.*[ ]-E[BL]/b f
|
||||
/collect.*[ ]-E[BL]/b f
|
||||
/OUTPUT_FORMAT[^)]*$/{N
|
||||
s/\n[ ]*/ /
|
||||
}
|
||||
t o
|
||||
: o
|
||||
s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/
|
||||
t q
|
||||
s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\2,\3/
|
||||
t s
|
||||
s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/
|
||||
t q
|
||||
d
|
||||
: s
|
||||
s/"//g
|
||||
G
|
||||
s/\n//
|
||||
s/^\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\1)/p
|
||||
s/^\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\2)/p
|
||||
/,/s/^/*** BUG in libc/scripts/output-format.sed *** /p
|
||||
q
|
||||
: q
|
||||
s/"//g
|
||||
p
|
||||
q
|
||||
: f
|
||||
s/^.*[ ]-E\([BL]\)[ ].*$/,\1/
|
||||
t h
|
||||
s/^.*[ ]-E\([BL]\)$/,\1/
|
||||
t h
|
||||
d
|
||||
: h
|
||||
h
|
Loading…
Reference in New Issue
Block a user