4 rm -f sizeof
*.o sizeof-glibc sizeof-musl sizeof.diff tab_
*.html
7 MUSL
=$(MUSL
) .
/update.sh
9 ARCH
= x86_64 i386 arm mips m68k powerpc sh x32
11 abi
: $(ARCH
:%=data
/abi_type.
%.musl
) $(ARCH
:%=data
/abi_func.
%.musl
)
13 $(ARCH
:%=abi_type.
%.
cc) abi_func.
cc: tables
15 T-x86_64
= x86_64-linux-musl
16 T-i386
= i486-linux-musl
17 T-arm
= arm-linux-musleabi
18 T-mips
= mips-linux-musl
19 T-m68k
= m68k-linux-musl
20 T-powerpc
= powerpc-linux-musl
22 T-x32
= x86_64-linux-muslx32
24 data
/abi_type.
%.musl
: abi_type.
%.
cc
25 ARCH
=$* CXX
='$(T-$*)-g++ -nostdinc -isystem /tmp/T.$*/include' .
/abi_type_data.sh
>$@
26 data
/abi_func.
%.musl
: abi_func.
cc
27 CXX
='$(T-$*)-g++ -nostdinc -isystem /tmp/T.$*/include' .
/abi_func_data.sh
>$@
29 sizeof
: sizeof-glibc sizeof-musl
30 .
/sizeof-glibc
>data
/sizeof.ARCH.glibc
31 .
/sizeof-musl
>data
/sizeof.ARCH.musl
32 diff
-U1 data
/sizeof.ARCH.glibc data
/sizeof.ARCH.musl
>data
/sizeof.ARCH.diff || true
34 LIBGCC
=`gcc -print-file-name=libgcc.a |sed 's,/libgcc.a$$,,'`
35 # when compiling with pcc
36 #PCC=`pcc -v foobar.o 2>&1 |sed -n 's,.* \([^ ]*\)/lib/crtbegin.o.*,\1,p'`
41 sizeof-glibc
: sizeof.c
42 gcc
-std
=gnu99
-o
$@
$<
44 gcc
-std
=gnu99
-nostdinc
-fno-stack-protector
-isystem
$(MUSL
)/include -isystem
$(LIBGCC
) -isystem
/usr
/include -c
-o
$@.o
$<
45 ld -o
$@
$@.o
-X
-d
-e _start
-Bstatic
$(MUSL
)/lib
/crti.o
$(MUSL
)/lib
/crt1.o
$(MUSL
)/lib
/crtn.o
-L
$(MUSL
)/lib
-lc
-L
$(LIBGCC
) -lgcc
-nostdlib
46 # ld -o $@ $@.o $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -dynamic-linker $(MUSL)/lib/libc.so -L$(LIBGCC) -lgcc -nostdlib
47 # pcc -nostdinc -isystem $(MUSL)/include -isystem $(PCC)/include -c -o $@.o $<
48 # ld -X -d -e _start -Bstatic -o $@ $@.o $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(PCC)/lib/crtbegin.o $(PCC)/lib/crtend.o -L$(MUSL)/lib -lc -L$(PCC)/lib -lpcc -nostdlib
51 g
++ -std
=gnu99
-nostdinc
-fno-stack-protector
-isystem
$(MUSL
)/include -isystem
$(LIBGCC
) -isystem
/usr
/include -c
-o
$@.o
$<
52 ld -o
$@
$@.o
-X
-d
-e _start
-Bstatic
$(MUSL
)/lib
/crti.o
$(MUSL
)/lib
/crt1.o
$(MUSL
)/lib
/crtn.o
-L
$(MUSL
)/lib
-lc
-L
$(LIBGCC
) -lgcc
-nostdlib
59 abi.ARCH.glibc
: abi_type.
cc
60 g
++ -std
=c
++11 $(GLIBC_FLAGS
) -c
-o
$@.o
$<
61 nm
-C
$@.o |sed
-n
's/^[[:xdigit:]]* T //p' |
sort >$@
62 abi.ARCH.musl
: abi_type.
cc
63 g
++ -std
=c
++11 -nostdinc
-fno-stack-protector
-isystem
$(MUSL
)/include -isystem
$(LIBGCC
) -isystem
/usr
/include -c
-o
$@.o
$<
64 nm
-C
$@.o |sed
-n
's/^[[:xdigit:]]* T //p' |
sort >$@
65 abi.ARCH.diff
: abi.ARCH.glibc abi.ARCH.musl
66 diff
-U0
$^
>$@ || true