Pre-built crosstool-ng toolchains built in /home/leming

Development on core packages and the distribution goes on in here.

Pre-built crosstool-ng toolchains built in /home/leming

Postby archvinz » Sun May 17, 2020 3:05 pm

Dear all

I hope this is the correct place to write for my problem.
After loosing 2 hours figuring out why my distcc didn't want to run cross compiling gcc for armv7, I finally found the issue.
The toolchain I used is the one from this topic :
https://archlinuxarm.org/wiki/Distcc_Cross-Compiling
And this one for my pi 2 : https://archlinuxarm.org/builder/xtools ... s7h.tar.xz

After a long struggle here is the sump up :
- I created a simple hello world program, named taist.c
Running this, works fine :
PATH=/opt/x-tools7h/arm-unknown-linux-gnueabihf/bin:/usr/bin armv7l-unknown-linux-gnueabihf-gcc -c taist.c -Wall
No error, generated taist.o is correct.
Howere running the same line on a preprocessed file (like distcc do), lead to an error :
PATH=/opt/x-tools7h/arm-unknown-linux-gnueabihf/bin:/usr/bin armv7l-unknown-linux-gnueabihf-gcc -c taist.i -Wall
cc1: error: /home/leming/x-tools7h-new/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/home/leming/x-tools7h-new/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/include: Permission denied
cc1: error: /home/leming/x-tools7h-new/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/usr/include: Permission denied

(taist.i is only the output of armv7l-unknown-linux-gnueabihf-gcc -E)

If I do the same thing with the native gcc of my x86-64 (archlinux) no error at all.

This issue on my system is that /home is not accessible to some users (for example user nobody run by distcc), /home is an NFS mount.

But what is not an issue for the x86-64 gcc is an issue for the cross compilation gcc.

gcc from archlinux seems to have been built from a /build directory :
# strings /usr/bin/gcc | grep configure | grep prefix
/build/gcc/src/gcc/configure [...] blabla

the cross compilation gcc seems to have been built from a /home/leming directory :
strings /opt/x-tools7h/arm-unknown-linux-gnueabihf/bin/gcc | grep configure | grep prefix
/home/leming/cross/bin/.build/arm-unknown-linux-gnueabihf/src/gcc/configure [...] blabla

If I umount my /home directory, the cross compilation gcc works fine, and doing an ls on :
/home/leming/x-tools7h-new/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/home/leming/x-tools7h-new/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/include
returns File Not Found instead of Permission denied

File Not Found is ok for gcc, but if it get an Permission Denied it simply stops.

So, I don't know if the issue is at gcc side, or if the x-tools from archlinux arm should be built from a non existing directory (like /build from standard archlinux gcc), but I just wanted to write this post to avoid someone else to loose 2 hours of his time :)

Thank you for reading
archvinz
 
Posts: 3
Joined: Sun May 17, 2020 2:44 pm

Re: Pre-built crosstool-ng toolchains built in /home/leming

Postby graysky » Sun May 17, 2020 3:27 pm

Are you wanting to build x86_64 packages or armv7h packages?

If you want to build x86_64 pakcages, try this and report back: https://aur.archlinux.org/packages/distccd-x86_64/
If you want to build armv7h packages, try this and report back: https://aur.archlinux.org/packages/dist ... rm-armv7h/
graysky
Developer
 
Posts: 1727
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Pre-built crosstool-ng toolchains built in /home/leming

Postby archvinz » Sun May 17, 2020 5:42 pm

Hi

I want to build armv7h package using a distcc x86_64 with xtools.
I already use package from here : https://aur.archlinux.org/packages/dist ... rm-armv7h/

Issue is solved when unmounting /home, so that nobody user has access to it.
archvinz
 
Posts: 3
Joined: Sun May 17, 2020 2:44 pm

Re: Pre-built crosstool-ng toolchains built in /home/leming

Postby graysky » Sun May 17, 2020 5:52 pm

$this->bbcode_second_pass_quote('archvinz', 'H')i

I want to build armv7h package using a distcc x86_64 with xtools.
I already use package from here : https://aur.archlinux.org/packages/dist ... rm-armv7h/

Issue is solved when unmounting /home, so that nobody user has access to it.


I am confused over the status of /home entirely... my package you're using shouldn't care.
graysky
Developer
 
Posts: 1727
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Pre-built crosstool-ng toolchains built in /home/leming

Postby archvinz » Mon May 18, 2020 8:01 am

Hi

I think that the issue is not linked to your aur package.
The issue seems to be linked the way gcc has been compiled in the x-tools package.

I don't know why gcc looks for this file when compiling a preprocessed file :
cc1: error: /home/leming/x-tools7h-new/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/home/leming/x-tools7h-new/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/include: Permission denied

But when looking at this file, if the error is Permission denied, gcc stops. In case the error is File Not Found, then gcc doesn't stop.

I never see this case with the regular archlinux gcc (x86_64) because it seems to have been built under a /build directory (directory that doesn't exist on my system).

So maybe it's an upstream gcc bug, or maybe gcc should be built using a non existing root path (like /build and not /home).

Thank you for your answer.
archvinz
 
Posts: 3
Joined: Sun May 17, 2020 2:44 pm


Return to Arch Linux ARM

Who is online

Users browsing this forum: No registered users and 7 guests