OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:30 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: make: i686-elf-gcc: Command not found (error 127)
PostPosted: Sun Jan 27, 2019 11:04 am 
Offline

Joined: Tue Aug 12, 2014 4:49 am
Posts: 9
So I've got meaty skeleton working before, then got rid of the VM, and now after some time, I thougt I'd play around again. Cross-compiled binutils 2.31 and gcc 8.2.0 with i686-elf target exactly as the tutorial said, no errors came up, gcc is in $HOME/opt/cross/bin and working, as I can compile bare bones just fine. But whenever I try to build meaty skeleton with the included scripts and makefile, I get the following error:

Quote:
david@OSDev:~/src/meaty-skeleton$ sudo ./qemu.sh
[sudo] password for david:
mkdir -p /home/david/src/meaty-skeleton/sysroot/usr/include
cp -R --preserve=timestamps include/. /home/david/src/meaty-skeleton/sysroot/usr/include/.
mkdir -p /home/david/src/meaty-skeleton/sysroot/usr/include
cp -R --preserve=timestamps include/. /home/david/src/meaty-skeleton/sysroot/usr/include/.
mkdir -p /home/david/src/meaty-skeleton/sysroot/usr/include
cp -R --preserve=timestamps include/. /home/david/src/meaty-skeleton/sysroot/usr/include/.
i686-elf-gcc --sysroot=/home/david/src/meaty-skeleton/sysroot -isystem=/usr/include -MD -c stdio/printf.c -o stdio/printf.libk.o -std=gnu11 -O2 -g -ffreestanding -Wall -Wextra -D__is_libc -Iinclude -D__is_libk
make: i686-elf-gcc: Command not found
make: *** [Makefile:72: stdio/printf.libk.o] Error 127

I installed all the required packages (xorriso, qemu, grub), I followed the tutorial to the letter, I cloned the repo from gitlab, I tried moving the source around, but it's still not working. I ran "export PATH="$HOME/opt/cross/bin:$PATH"", $PATH gets properly set, I can call i686-elf-gcc directly and it works. Yet make apparently still can't find it.

Anyone got any ideas why this happens? I searched the forum for this and a few similar issues came up but nothing mentioned in those topics helped me solve this. This is on kubuntu 18.10 64-bit btw.


Top
 Profile  
 
 Post subject: Re: make: i686-elf-gcc: Command not found (error 127)
PostPosted: Sun Jan 27, 2019 11:55 am 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
Probably because your root user doesn't have the environment variables set that your user account does. Does it work if you use sudo -E ./qemu.sh ? Might be easier to specify the full path of i686-elf-gcc inside your Makefile.


Top
 Profile  
 
 Post subject: Re: make: i686-elf-gcc: Command not found (error 127)
PostPosted: Sun Jan 27, 2019 12:56 pm 
Offline

Joined: Tue Aug 12, 2014 4:49 am
Posts: 9
MichaelPetch wrote:
Probably because your root user doesn't have the environment variables set that your user account does. Does it work if you use sudo -E ./qemu.sh ? Might be easier to specify the full path of i686-elf-gcc inside your Makefile.

sudo -E didn't work, but it did lead me to find out the sysroot folder was owned by root, not me, which is why I had to run the script as root. It works now that I've changed the owner, which eliminates that requirement. Thanks for the help. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot] and 58 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group