iit-danieli-joint-lab / idjl-gcc-vxworks

Helpers script to compile a version of GCC that crosscompiles to VxWorks.
4 stars 3 forks source link

Create sys_select.h #25

Closed traversaro closed 2 years ago

traversaro commented 2 years ago

Fix https://github.com/iit-danieli-joint-lab/idjl-gcc-vxworks/issues/24

traversaro commented 2 years ago

fyi @strongly-typed

strongly-typed commented 2 years ago

Thanks for the quick fix. Seems to work. Did not compile anything with it yet.

The next copy command

https://github.com/iit-danieli-joint-lab/idjl-gcc-vxworks/blob/6420f4629c2c68e4b0282555de37c34b4db735c3/build_idjl_gcc_vxworks.sh#L135

does not work.

make[1]: Leaving directory '/root/idjl-gcc-vxworks/build-gcc'
cp: cannot stat '/root/idjl-gcc-vxworks/wrs-vxworks-headers/i586-wrs-vxworks/sys-include/wrn/coreip/net/uio.h': No such file or directory
FAILED COMMAND: cp ${SCRIPTPATH}/wrs-vxworks-headers/i586-wrs-vxworks/sys-include/wrn/coreip/net/uio.h $INSTALL_PATH/include/i586-wrs-vxworks/idjl-include/sys/uio.h

The file uio.h is present here:

root@debian:~/idjl-gcc-vxworks# find . -iname "uio.h"
./install/i586-wrs-vxworks/wrn/coreip/net/uio.h
./install/i586-wrs-vxworks/sys-include/wrn/coreip/net/uio.h
./wrs-vxworks-headers/include/net/uio.h
./wrs-vxworks-headers/wind_base/target/h/net/uio.h
./wrs-vxworks-headers/sys-include/wrn/coreip/net/uio.h
./gccdist/WindRiver/vxworks-6.3/target/h/wrn/coreip/net/uio.h

Running in fresh a Debian 9 i386 VM for testing:

root@debian:~/idjl-gcc-vxworks# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.13 (stretch)
Release:    9.13
Codename:   stretch
traversaro commented 2 years ago

Thanks, probably this was a regression done in https://github.com/iit-danieli-joint-lab/idjl-gcc-vxworks/pull/13 as I had manually copied the file in https://github.com/iit-danieli-joint-lab/idjl-gcc-vxworks/releases/tag/v0.3.2 instead of re-running the script. I am a bit out of time to fix this, but you could check the content of $INSTALL_PATH/include/i586-wrs-vxworks/idjl-include/sys/uio.h in https://github.com/iit-danieli-joint-lab/idjl-gcc-vxworks/releases/tag/v0.3.2 and compare it among the possible options you listed:

root@debian:~/idjl-gcc-vxworks# find . -iname "uio.h"
./install/i586-wrs-vxworks/wrn/coreip/net/uio.h
./install/i586-wrs-vxworks/sys-include/wrn/coreip/net/uio.h
./wrs-vxworks-headers/include/net/uio.h
./wrs-vxworks-headers/wind_base/target/h/net/uio.h
./wrs-vxworks-headers/sys-include/wrn/coreip/net/uio.h
./gccdist/WindRiver/vxworks-6.3/target/h/wrn/coreip/net/uio.h

if it matches one of the files, we know which version we can use to fix the script.

strongly-typed commented 2 years ago

All files are equal ;-)

root@debian:~/idjl-gcc-vxworks# find . -iname "uio.h" -exec sha1sum {} \;
7aac3bc6d04737c5da2ab494be7314517d0d5876  ./install/wrs-vxworks-headers/include/net/uio.h
7aac3bc6d04737c5da2ab494be7314517d0d5876  ./install/wrs-vxworks-headers/wind_base/target/h/net/uio.h
7aac3bc6d04737c5da2ab494be7314517d0d5876  ./install/wrs-vxworks-headers/sys-include/wrn/coreip/net/uio.h
7aac3bc6d04737c5da2ab494be7314517d0d5876  ./install/i586-wrs-vxworks/wrn/coreip/net/uio.h
7aac3bc6d04737c5da2ab494be7314517d0d5876  ./install/i586-wrs-vxworks/sys-include/wrn/coreip/net/uio.h
7aac3bc6d04737c5da2ab494be7314517d0d5876  ./wrs-vxworks-headers/include/net/uio.h
7aac3bc6d04737c5da2ab494be7314517d0d5876  ./wrs-vxworks-headers/wind_base/target/h/net/uio.h
7aac3bc6d04737c5da2ab494be7314517d0d5876  ./wrs-vxworks-headers/sys-include/wrn/coreip/net/uio.h
7aac3bc6d04737c5da2ab494be7314517d0d5876  ./gccdist/WindRiver/vxworks-6.3/target/h/wrn/coreip/net/uio.h
traversaro commented 2 years ago

Great, so I guess https://github.com/iit-danieli-joint-lab/idjl-gcc-vxworks/commit/c366074189b29be32816f269bf3721dc921e9c37 should fix the problem.

strongly-typed commented 2 years ago

I am running into a very strange issue ... I am sure that I had a successful run in my VM and had a working compiler.

Suddenly, I got while compiling the compiler:

/root/idjl-gcc-vxworks/build-gcc/./gcc/xgcc -B/root/idjl-gcc-vxworks/build-gcc/./gcc/ -B/root/idjl-gcc-vxworks/install/i586-wrs-vxworks/bin/ -B/root/idjl-gcc-vxworks/install/i586-wrs-vxworks/lib/ -isystem /root/idjl-gcc-vxworks/install/i586-wrs-vxworks/include -isystem /root/idjl-gcc-vxworks/install/i586-wrs-vxworks/sys-include    -g -O2 -O2 -nostdinc -I `case "/$(MULTIDIR)" in */mrtp*) echo /h ;; *) echo /root/idjl-gcc-vxworks/wrs-vxworks-headers/wind_base/target/h ;; esac` -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include    -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I. -I../.././gcc -I../../../gcc-7.3.0/libgcc -I../../../gcc-7.3.0/libgcc/. -I../../../gcc-7.3.0/libgcc/../gcc -I../../../gcc-7.3.0/libgcc/../include  -DHAVE_CC_TLS  -o unwind-sjlj.o -MT unwind-sjlj.o -MD -MP -MF unwind-sjlj.dep -fexceptions -c ../../../gcc-7.3.0/libgcc/unwind-sjlj.c -fvisibility=hidden -DHIDE_EXPORTS
/bin/bash: line 1: MULTIDIR: command not found
In file included from ../../../gcc-7.3.0/libgcc/gthr.h:148:0,
                 from ../../../gcc-7.3.0/libgcc/unwind-dw2.c:37:
./gthr-default.h:35:10: fatal error: pthread.h: No such file or directory
 #include <pthread.h>
          ^~~~~~~~~~~
compilation terminated.

I am testing in Debian 9 and Debian 11 (i386). I reinstalled the VM from scratch and still hitting this error. pthread.h is installed

root@debian:~/idjl-gcc-vxworks# find . -iname "pthread.h"
./gccdist/WindRiver/vxworks-6.3/target/h/pthread.h
./install/i586-wrs-vxworks/pthread.h
./gcc-7.3.0/fixincludes/tests/base/pthread.h
./gcc-7.3.0/fixincludes/tests/base/sys/pthread.h
./wrs-vxworks-headers/sys-include/pthread.h

It is reproducible in the GitHub action in a Linux container.

Any ideas?

traversaro commented 2 years ago

Sorry, I do not know what could be the problem. Anyhow, I think we can merge this.