tkchia / gcc-ia16

Fork of Lambertsen & Jenner (& al.)'s IA-16 (Intel 16-bit x86) port of GNU compilers ― added far pointers & more • use https://github.com/tkchia/build-ia16 to build • Ubuntu binaries at https://launchpad.net/%7Etkchia/+archive/ubuntu/build-ia16/ • DJGPP/MS-DOS binaries at https://gitlab.com/tkchia/build-ia16/-/releases • mirror of https://gitlab.com/tkchia/gcc-ia16
GNU General Public License v2.0
178 stars 13 forks source link

Far thunking breaks GCC build #41

Closed mfld-fr closed 5 years ago

mfld-fr commented 5 years ago

I tried to build your latest commit (bfd61dc), and I got an error:

/mnt/data/usr/src/advantech/cross/build/gcc-build/./gcc/xgcc -B/mnt/data/usr/src/advantech/cross/build/gcc-build/./gcc/ -B/home/mfld/advantech/elks-ia16/cross/ia16-elf/bin/ -B/home/mfld/advantech/elks-ia16/cross/ia16-elf/lib/ -isystem /home/mfld/advantech/elks-ia16/cross/ia16-elf/include -isystem /home/mfld/advantech/elks-ia16/cross/ia16-elf/sys-include    -g -O2 -mrtd -O2  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I. -I../../.././gcc -I../../../../gcc-src/libgcc -I../../../../gcc-src/libgcc/. -I../../../../gcc-src/libgcc/../gcc -I../../../../gcc-src/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o far-apply-thunk.o -MT far-apply-thunk.o -MD -MP -MF far-apply-thunk.dep  -c ../../../../gcc-src/libgcc/config/ia16/far-apply-thunk.c -fvisibility=hidden -DHIDE_EXPORTS
cc1: attention : le ssytème cible ne supporte pas la sortie pour mise au point
cc1: attention : le ssytème cible ne supporte pas la sortie pour mise au point
cc1: attention : le ssytème cible ne supporte pas la sortie pour mise au point
../../../../gcc-src/libgcc/config/ia16/far-apply-thunk.c:28:23: erreur fatale : sys/types.h : Aucun fichier ou dossier de ce type
 #include <sys/types.h>
                       ^
compilation terminée.
make[5]: *** [../../../../gcc-src/libgcc/static-object.mk:17: far-apply-thunk.o] Error 1

GCC is built that way (from ELKS tools/Makefile):

cd gcc-build && ../gcc-src/configure --target=ia16-elf --prefix="$(CROSSDIR)" --without-headers --enable-languages=c --disable-libssp --without-isl
make -C gcc-build

I guess the root cause is not linked to #40, so I opened a distinct issue for this one.

mfld-fr commented 5 years ago

Additional info: build is successful with 5788d029e7b6f78e2d2e50bfef50053ceda2ed15 (= latest tag).

tkchia commented 5 years ago

Hello @mfld-fr ,

Thanks for the report. I guess I did not notice that <sys/types.h> was tied to a C runtime library, and that libgcc.a should only need whatever facilities are available from the compiler itself.

(I had been trying to add some support for calling near functions (in the default text segment) from other text segments, using some sort of thunking (this will make the far_section function attribute a lot more useful than it is now). I have reverted the problematic commit --- since it seems I will need to redo the implementation in any case.)

Thank you!

mfld-fr commented 5 years ago

Just tested with commit 2aa70f8c292e4e67b980d7468a011206130bfd7d: build completes now without any error. Thank you for the quick fix !