LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   binutils cannot open: Permission denied error. (https://www.linuxquestions.org/questions/linux-from-scratch-13/binutils-cannot-open-permission-denied-error-944679/)

roshgorg 05-12-2012 11:46 PM

binutils cannot open: Permission denied error.
 
Though I am a newbie, I am in the task of building my own Linux using the book LFS.
I met with the following error in chapter 5.4.1 . When I did the code
Code:

mkdir -v ../binutils-build
The error was:
Code:

lfs@debian:/mnt/lfs/sources$ tar -jxf binutils-2.22.tar.bz2
tar (child): binutils-2.22.tar.bz2: Cannot open: Permission denied
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

When I checked ls -l, the permissions was set to root. But I have already done the codes
Code:

chown -v lfs $LFS/tools
chown -v lfs $LFS/sources

Why is it that the permissions are set to root ?

Why is it that I cannot continue ?

spiky0011 05-13-2012 01:26 AM

Hi

What version of LFS are you doing?
You should also be in the binutiles-build dir

Code:

mkdir -v ../binutils-build
cd ../binutils-build

When you untar you then cd into the created dir before continuing with the chapter

Sorry misread your post, Did you do all of chapter4.3

the chown of LFS/tools and LFS/sources

roshgorg 05-13-2012 02:20 AM

Quote:

Originally Posted by spiky0011 (Post 4677084)
Hi

What version of LFS are you doing?
You should also be in the binutiles-build dir

Code:

mkdir -v ../binutils-build
cd ../binutils-build

When you untar you then cd into the created dir before continuing with the chapter

Sorry misread your post, Did you do all of chapter4.3

the chown of LFS/tools and LFS/sources


yes, I rectified that error.
I am using version 7.1
Now I got another problem...
My problem is, when in chapter 5.4.1, when running
Code:

../binutils-2.22/configure \--target=$LFS_TGT --prefix=/tools \--disable-nls --disable-werror
I get the following output
Code:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-lfs-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... mawk
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/mnt/lfs/sources/binutils-build':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

If i ignore the warnings and continue with 'make', I get the following error
Code:

make: *** No targets specified and no makefile found.  Stop.

spiky0011 05-13-2012 02:49 AM

Hi

Did you make sure your host system was compatible
here

roshgorg 05-13-2012 03:00 AM

Quote:

Originally Posted by spiky0011 (Post 4677102)
Hi

Did you make sure your host system was compatible
here


The prerequisites aren't met. How to install all those files at once ? Will it be possible to do it just by running sudo apt-get update && apt-get upgrade ?

spiky0011 05-13-2012 03:05 AM

Hi

I take it your using Ubuntu as host, I had trouble with make info failing on Ubuntu, Debain was easier to use.

FYI

Just installed texinfo from software manager it cleared version-check
(maybe something went wrong last time)

roshgorg 05-14-2012 01:12 AM

I abandoned that project, and started with a fresh LFS.

Now I am at Binutils-2.22 - Pass 1 , that is at chapter 5.4.1
After creating the directory binutils-build, ans issueing the command
Code:

../binutils-2.22/configure \
--target=$LFS_TGT --prefix=/tools \
--disable-nls --disable-werror

I get the following error
Code:

lfs@debian:/mnt/lfs/sources/binutils-build$ ../binutils-2.22/configure \
> --target=$LFS_TGT --prefix=/tool \
> --disable-nls --disable-werror
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-lfs-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: in `/mnt/lfs/sources/binutils-build':
configure: error: C compiler cannot create executables
See `config.log' for more details.

1) Why is this? I didn't met with such an error in my previous attempt.

2) Also, when running commands that extend to multiple lines with \ at the end, what am I supposed to do ? That is, whether, I should press enter key and continue with the next line, ar put no space between (\) and the enxt character ?

spiky0011 05-14-2012 12:49 PM

Hi

I dont know whats wrong with your build, Maybe pastebin the config file might help.
Also can you post the output of the version-check.
Yes with the \ that is correct a space then \ then enter which will let you continue on next line
--target=$LFS_TGT --prefix=/tools \
A space between tools and \

stoat 05-14-2012 05:15 PM

When I searched for "configure: error: C compiler cannot create executables", I saw it discussed fairly often. A common issue that I saw was some compiler component missing from the host system. Try confirming that you've installed the things you need to compile source in Debian. I haven't used Debian in a while, so I don't remember what those things are. In Fedora, for example (since I know it better), it's things like the Development Tools group, Development Libraries group, kernel-devel, kernel-headers. Those aren't installed by default in Fedora. The idea will probably be similar in Debian but the things will called something else. It might be things like build-essential, dpkg-dev, fakeroot, etc. Maybe a Debian expert will show up with the precise details. Anyway, this is what I would at least investigate. I predict that until you do that, you couldn't compile anything in your Debian system whether it be for LFS or the Debian system itself.

octagonking 03-14-2017 08:15 AM

Try to use xf or xvf for untaring the package .. hope it help
Code:

lfs@debian:/mnt/lfs/sources$ tar xf binutils-2.22.tar.bz2

Quote:

Originally Posted by roshgorg (Post 4677049)
Though I am a newbie, I am in the task of building my own Linux using the book LFS.
I met with the following error in chapter 5.4.1 . When I did the code
Code:

mkdir -v ../binutils-build
The error was:
Code:

lfs@debian:/mnt/lfs/sources$ tar -jxf binutils-2.22.tar.bz2
tar (child): binutils-2.22.tar.bz2: Cannot open: Permission denied
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

When I checked ls -l, the permissions was set to root. But I have already done the codes
Code:

chown -v lfs $LFS/tools
chown -v lfs $LFS/sources

Why is it that the permissions are set to root ?

Why is it that I cannot continue ?


szboardstretcher 03-14-2017 09:18 AM

If you download the binaries as root, they will have root permissions. You should be the lfs user when downloading into your sources directory.


All times are GMT -5. The time now is 07:01 AM.