aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am20
1 files changed, 8 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index 33f770f6..2f418bea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -167,31 +167,27 @@ gnumach_o_LINK = $(LD) $(LDFLAGS) -u _start -r -o $@
noinst_PROGRAMS += \
gnumach.o
-# This is the list of routines we decide is OK to steal from the C library or libgcc.
-clib_routines := htonl htons ntohl ntohs \
- udivdi3 __udivdi3 __udivmoddi4 __umoddi3 \
- __divdi3 __moddi3 \
- __rel_iplt_start __rel_iplt_end \
- __rela_iplt_start __rela_iplt_end \
- __ffsdi2 \
- _START _start etext _edata end _end # actually ld magic, not libc.
+# This is the list of routines we use from libgcc.
+libgcc_routines := __udivmoddi4 __umoddi3 __ffsdi2
+# References generated by ld.
+ld_magic_routines := __rel_iplt_start __rel_iplt_end etext _edata _end
gnumach-undef: gnumach.$(OBJEXT)
$(NM_V) $(NM) -u $< | sed 's/ *U *//' | sort -u > $@
MOSTLYCLEANFILES += gnumach-undef
gnumach-undef-bad: gnumach-undef Makefile
- $(AM_V_GEN) sed '$(foreach r,$(clib_routines),/^$r$$/d;)' $< > $@
+ $(AM_V_GEN) sed '$(foreach r,$(libgcc_routines) $(ld_magic_routines),/^$r$$/d;)' $< > $@
MOSTLYCLEANFILES += gnumach-undef-bad
-clib-routines.o: gnumach-undef gnumach-undef-bad
+libgcc-routines.o: gnumach-undef gnumach-undef-bad
$(AM_V_at) if test -s gnumach-undef-bad; \
then cat gnumach-undef-bad; exit 2; else true; fi
$(AM_V_CCLD) $(CCLD) $(LDFLAGS) -nostdlib -nostartfiles -r -static \
- -o $@ `sed 's/^/-Wl,-u,/' < $<` -x c /dev/null -lc -lgcc
+ -o $@ `sed 's/^/-Wl,-u,/' < $<` -x c /dev/null -lgcc
@if nm $@ | grep __init_cpu_features; \
then echo "Please install a 32bit libc without multiarch support (on Debian systems, the libc6-dev:i386 package containing /usr/lib/i386-linux-gnu/libc.a)". ; \
false ; fi
gnumach_LINK = $(LD) $(LDFLAGS) $(LINKFLAGS) $(gnumach_LINKFLAGS) -o $@
-gnumach_LDADD = gnumach.o clib-routines.o
+gnumach_LDADD = gnumach.o libgcc-routines.o
#
# Installation.