abhiTronix / raspberry-pi-cross-compilers

Latest GCC Cross Compiler & Native (ARM & ARM64) CI generated precompiled standalone toolchains for all Raspberry Pis. 🍇
https://sourceforge.net/projects/raspberry-pi-cross-compilers
GNU General Public License v3.0
594 stars 104 forks source link

crtn.o crt1.o crti.o is not valid destination #85

Closed SFMetec closed 2 years ago

SFMetec commented 2 years ago

Hello,

I'm following your guide, I'm using raspberry pi3 b+ with Raspbian Stretch Lite.

When I add symbolic link with SSymlinker I have the errors below:

./SSymlinker -s /usr/lib/arm-linux-gnueabihf/crtn.o -d /usr/lib/crtn.o
/usr/lib/crtn.o is not valid destination. Aborting!
./SSymlinker -s /usr/lib/arm-linux-gnueabihf/crt1.o -d /usr/lib/crt1.o
/usr/lib/crt1.o is not valid destination. Aborting!
./SSymlinker -s /usr/lib/arm-linux-gnueabihf/crti.o -d /usr/lib/crti.o
/usr/lib/crti.o is not valid destination. Aborting!

What am I doing wrong?

abhiTronix commented 2 years ago

@SFMetec What's the value if you run readlink -f /usr/lib/crti.o

SFMetec commented 2 years ago

@SFMetec What's the value if you run readlink -f /usr/lib/crti.o

pi@raspberrypi:~ $ readlink -f /usr/lib/crti.o
/usr/lib/crti.o
abhiTronix commented 2 years ago

@SFMetec OK I've found the problem. Please wait.

SFMetec commented 2 years ago

This the result of other link

pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/asm -d /usr/include
'/usr/include/asm' -> '/usr/include/arm-linux-gnueabihf/asm'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/gnu -d /usr/include
'/usr/include/gnu' -> '/usr/include/arm-linux-gnueabihf/gnu'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/bits -d /usr/include
'/usr/include/bits' -> '/usr/include/arm-linux-gnueabihf/bits'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/sys -d /usr/include
'/usr/include/sys/*' -> '/usr/include/arm-linux-gnueabihf/sys/*'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/openssl -d /usr/include
'/usr/include/openssl/*' -> '/usr/include/arm-linux-gnueabihf/openssl/*'
abhiTronix commented 2 years ago

@SFMetec Re-clone and check if problem is fixed.

SFMetec commented 2 years ago

@SFMetec Re-clone and check if problem is fixed.

pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/asm -d /usr/include
./SSymlinker: line 56: syntax error in conditional expression: unexpected token `;'
abhiTronix commented 2 years ago

@SFMetec Hold on another bug is there.

abhiTronix commented 2 years ago

@SFMetec Finally done, check again.

SFMetec commented 2 years ago

@SFMetec Finally done, check again.

Thank a lot, now I can go on

pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/asm -d /usr/include
'/usr/include/asm' -> '/usr/include/arm-linux-gnueabihf/asm'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/gnu -d /usr/include
'/usr/include/gnu' -> '/usr/include/arm-linux-gnueabihf/gnu'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/bits -d /usr/include'/usr/include/bits' -> '/usr/include/arm-linux-gnueabihf/bits'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/sys -d /usr/include
'/usr/include/sys/*' -> '/usr/include/arm-linux-gnueabihf/sys/*'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/openssl -d /usr/include
'/usr/include/openssl/*' -> '/usr/include/arm-linux-gnueabihf/openssl/*'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/lib/arm-linux-gnueabihf/crtn.o -d /usr/lib/crtn.o
'/usr/lib/crtn.o' -> '/usr/lib/arm-linux-gnueabihf/crtn.o'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/lib/arm-linux-gnueabihf/crt1.o -d /usr/lib/crt1.o
'/usr/lib/crt1.o' -> '/usr/lib/arm-linux-gnueabihf/crt1.o'
pi@raspberrypi:~ $ ./SSymlinker -s /usr/lib/arm-linux-gnueabihf/crti.o -d /usr/lib/crti.o
'/usr/lib/crti.o' -> '/usr/lib/arm-linux-gnueabihf/crti.o'
abhiTronix commented 2 years ago

@SFMetec Thanks a lot for confirming. It was a very annoying bug.

SFMetec commented 2 years ago

During compilation I have the error below


.obj/qharfbuzzng.o: In function `hb_qt_font_get_for_engine(QFontEngine*)':
qharfbuzzng.cpp:(.text+0x1220): undefined reference to `hb_font_set_ptem'
collect2: error: ld returned 1 exit status
SFMetec commented 2 years ago

During compilation I have the error below


.obj/qharfbuzzng.o: In function `hb_qt_font_get_for_engine(QFontEngine*)':
qharfbuzzng.cpp:(.text+0x1220): undefined reference to `hb_font_set_ptem'
collect2: error: ld returned 1 exit status

After resync the build is successfully terminated but when I try to compile a new empty project I have:

/home/xxxx/rpi-qt/sysroot/usr/include/features.h:364: error: sys/cdefs.h: No such file or directory
 #  include <sys/cdefs.h>
abhiTronix commented 2 years ago

After resync the build is successfully terminated but when I try to compile a new empty project I have:

/home/xxxx/rpi-qt/sysroot/usr/include/features.h:364: error: sys/cdefs.h: No such file or directory

include <sys/cdefs.h>

Meaning rysnc didn't worked peoperly, resync each folder again and look for any error. Also, check if missed any step when you tried to compile new project.

abhiTronix commented 2 years ago

During compilation I have the error below

.obj/qharfbuzzng.o: In function hb_qt_font_get_for_engine(QFontEngine*)': qharfbuzzng.cpp:(.text+0x1220): undefined reference tohb_font_set_ptem' collect2: error: ld returned 1 exit status

and this is a unresolved QT bug: https://bugreports.qt.io/browse/QTBUG-72956

SFMetec commented 2 years ago

The rync works fine because the cdefs.h is available in ~/rpi-qt/sysroot/usr/include/arm-linux-gnueabihf/sys

But the error is still there

abhiTronix commented 2 years ago

The rync works fine because the cdefs.h is available in ~/rpi-qt/sysroot/usr/include/arm-linux-gnueabihf/sys

That's not important, Is it available at ~/rpi-qt/sysroot/usr/include/sys?

SFMetec commented 2 years ago

No is not

~/rpi-qt/sysroot/usr/include/sys$ ls
'*'   acl.h   apparmor.h   apparmor_private.h   asoundlib.h   capability.h
abhiTronix commented 2 years ago

No is not

Then symlink failed. Check on Raspberry pi, does it have that?

abhiTronix commented 2 years ago

Also, what's '*'?

SFMetec commented 2 years ago

'*' -> '/usr/include/arm-linux-gnueabihf/sys/*'

SFMetec commented 2 years ago

No is not

Then symlink failed. Check on Raspberry pi, does it have that?

pi@raspberrypi:/usr/include/arm-linux-gnueabihf/sys $ ls -la | grep cdefs.h

-rw-r--r--  1 root root 15651 Feb  6  2019 cdefs.h
abhiTronix commented 2 years ago

`pi@raspberrypi:/usr/include/arm-linux-gnueabihf/sys $ ls -la | grep cdefs.h

-rw-r--r-- 1 root root 15651 Feb 6 2019 cdefs.h

Check in /usr/include/sys

abhiTronix commented 2 years ago

Does /usr/include/sys even exist?

SFMetec commented 2 years ago

No it doesn't exist

abhiTronix commented 2 years ago

SSymlinker didn't worked. Check other symlinks like: asm gnu bits?

abhiTronix commented 2 years ago

/usr/include/asm /usr/include/gnu /usr/include/bits

SFMetec commented 2 years ago

What I have to check?

abhiTronix commented 2 years ago

Also, run ls -la in /usr/include

abhiTronix commented 2 years ago

What I have to check?

Check if following symlinks exists or not on Raspberry pi.

/usr/include/asm
/usr/include/gnu
/usr/include/bits

@SFMetec I want to see if SSymlinker script fails for sys folder only or every other folders?

SFMetec commented 2 years ago
pi@raspberrypi:/usr/include $ ls -la asm
lrwxrwxrwx 1 root root 36 Nov 26 12:05 asm -> /usr/include/arm-linux-gnueabihf/asm
pi@raspberrypi:/usr/include $ ls -la gnu
lrwxrwxrwx 1 root root 36 Nov 26 12:05 gnu -> /usr/include/arm-linux-gnueabihf/gnu
pi@raspberrypi:/usr/include $ ls -la bits
lrwxrwxrwx 1 root root 37 Nov 26 12:05 bits -> /usr/include/arm-linux-gnueabihf/bits
abhiTronix commented 2 years ago

pi@raspberrypi:/usr/include $ ls -la asm lrwxrwxrwx 1 root root 36 Nov 26 12:05 asm -> /usr/include/arm-linux-gnueabihf/asm pi@raspberrypi:/usr/include $ ls -la gnu lrwxrwxrwx 1 root root 36 Nov 26 12:05 gnu -> /usr/include/arm-linux-gnueabihf/gnu pi@raspberrypi:/usr/include $ ls -la bits lrwxrwxrwx 1 root root 37 Nov 26 12:05 bits -> /usr/include/arm-linux-gnueabihf/bits

@SFMetec So this problem narrow downs to sys folder only.

abhiTronix commented 2 years ago

'' -> '/usr/include/arm-linux-gnueabihf/sys/'

@SFMetec This is wrong. You have to remove '*' first and then make symlink.

Do this:

sudo rm /usr/include/'*' # beware '*' is in quotes

Then run SSymlinker

./SSymlinker -s /usr/include/arm-linux-gnueabihf/sys -d /usr/include
 ls -la /usr/include/sys #verify
SFMetec commented 2 years ago

sudo rm /usr/include/'*' # beware '*' is in quotes

or

sudo rm /usr/include/sys/'*' # beware '*' is in quotes

?

abhiTronix commented 2 years ago

'*' is in /usr/include/sys or /usr/include?

SFMetec commented 2 years ago
pi@raspberrypi:/usr/include $ ls -la sys

drwxr-xr-x   2 root root  4096 Nov 26 12:05 .
drwxr-xr-x 117 root root 20480 Nov 26 12:05 ..
lrwxrwxrwx   1 root root    38 Nov 26 12:05 * -> /usr/include/arm-linux-gnueabihf/sys/*
-rw-r--r--   1 root root  3755 Feb 12  2016 acl.h
-rw-r--r--   1 root root  7774 Feb 27  2018 apparmor.h
-rw-r--r--   1 root root  1090 Feb 27  2018 apparmor_private.h
-rw-r--r--   1 root root    96 Mar 25  2019 asoundlib.h
-rw-r--r--   1 root root  3297 May 24  2016 capability.h
abhiTronix commented 2 years ago

Then do sudo rm /usr/include/sys/*.

abhiTronix commented 2 years ago

Leave quotes.

SFMetec commented 2 years ago
pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/sys -d /usr/include
'/usr/include/sys/*' -> '/usr/include/arm-linux-gnueabihf/sys/*'
abhiTronix commented 2 years ago

What's the content of /usr/include/sys? Do ls /usr/include/sys.

SFMetec commented 2 years ago

Then do sudo rm /usr/include/sys/*.

NO! I removed all files with * without quote! I was stupid

abhiTronix commented 2 years ago

NO! I removed all files with * without quote! I was stupid

That can't happen, sudo rm only works for file.

SFMetec commented 2 years ago

What's the content of /usr/include/sys? Do ls /usr/include/sys.

pi@raspberrypi:~ $ ls -la /usr/include/sys

drwxr-xr-x   2 root root  4096 Nov 26 16:27 .
drwxr-xr-x 117 root root 20480 Nov 26 12:05 ..
lrwxrwxrwx   1 root root    38 Nov 26 16:27 * -> /usr/include/arm-linux-gnueabihf/sys/*
abhiTronix commented 2 years ago

What all files btw?

abhiTronix commented 2 years ago

-rw-r--r-- 1 root root 3755 Feb 12 2016 acl.h -rw-r--r-- 1 root root 7774 Feb 27 2018 apparmor.h -rw-r--r-- 1 root root 1090 Feb 27 2018 apparmor_private.h -rw-r--r-- 1 root root 96 Mar 25 2019 asoundlib.h -rw-r--r-- 1 root root 3297 May 24 2016 capability.h

These files deleted? You can easily find them on internet, they're just header files.

SFMetec commented 2 years ago

Yes, those

abhiTronix commented 2 years ago

IDK, what's wrong, why it is creating * folder? Since you already have removed everything in sys, just do sudo rm -r /usr/include/sys. And then run SSymlinker.

SFMetec commented 2 years ago
pi@raspberrypi:~ $ sudo rm -r /usr/include/sys

pi@raspberrypi:~ $ ./SSymlinker -s /usr/include/arm-linux-gnueabihf/sys -d /usr/include

'/usr/include/sys' -> '/usr/include/arm-linux-gnueabihf/sys'

pi@raspberrypi:~ $  ls -la /usr/include/sys

lrwxrwxrwx 1 root root 36 Nov 26 16:35 /usr/include/sys -> /usr/include/arm-linux-gnueabihf/sys
abhiTronix commented 2 years ago

Now search if /usr/include/arm-linux-gnueabihf/sys/asoundlib.h exists?

SFMetec commented 2 years ago

No it not exist

abhiTronix commented 2 years ago

The problem is resolved, I'll tell you how to bring back those files but first I need to see something. Run following commands:

sudo rm /usr/include/sys
sudo mkdir /usr/include/sys

Then run SSymlinker again.

And verify:

ls -la /usr/include/sys