summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2022-12-16 14:56:36 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-17 02:32:35 +0100
commitcef6d34aa02698ec2a173bdc6f42ae979ac08cd9 (patch)
treef6dae656f71e5316883ebdfbae5dc3f44803cdd8 /Makefile.am
parentad51c68171cb6a1cae15c61ca0218bbee2c05485 (diff)
Implement our own functions to convert between host and network values
We add htonl, ntohl and ntohs which were the last symbols we relied on from libc. The Makefile.am file was updated to reflect the fact that we only require libgcc. Message-Id: <Y5zNdOJ/YnyYCOhX@mars>
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.