Skip to contentSkip to conversation

ARM cross compiler path error "no such file or directory"

Buildroot New Mark Jackson 4 participants 9 messages Jul 6, 2017 – Jul 8, 2017

lore
Share & tools
lore
#0 lore raw

I can successfully compile "beaglebone_defconfig".

$ make clean
$ make beaglebone_defconfig
$ make

And in output/host/usr/bin, I can find all the "arm-linux-xyz" cross compiler tools (gcc, strings, strip, etc).

But when I try to use these to compile my own code, I get an error as follows:-

$ which arm-linux-gcc
/home/mpfj/buildroot/output/host/usr/bin/arm-linux-gcc
$ arm-linux-gcc
/home/mpfj/buildroot/output/usr/bin/arm-linux-gcc.br_real: No such file or directory

Quite correctly, "output/usr/bin" doesn't exist ... the files are in "output/host/usr/bin"

                                                                             ^^^^

arm-linux-gcc is just a symlink to toolchain-wrapper, so toolchain-wrapper seems to be pointing to the wrong directory!!

I'm sure was working yesterday, but I did a "git pull" this morning, so it may be something quite recent ??

#1 lore raw

Hello,

Quoted 15 lines · Mark Jackson

I can successfully compile "beaglebone_defconfig".

$ make clean
$ make beaglebone_defconfig
$ make

And in output/host/usr/bin, I can find all the "arm-linux-xyz" cross compiler tools (gcc, strings, strip, etc).

But when I try to use these to compile my own code, I get an error as follows:-

$ which arm-linux-gcc
/home/mpfj/buildroot/output/host/usr/bin/arm-linux-gcc
$ arm-linux-gcc
/home/mpfj/buildroot/output/usr/bin/arm-linux-gcc.br_real: No such file or directory
Quoted 5 lines

Quite correctly, "output/usr/bin" doesn't exist ... the files are in "output/host/usr/bin"

arm-linux-gcc is just a symlink to toolchain-wrapper, so toolchain-wrapper seems to be pointing to the wrong directory!!

I'm sure was working yesterday, but I did a "git pull" this morning, so it may be something quite recent ??

We pushed some changes over the last few days that moved everything in $(HOST_DIR)/usr up into $(HOST_DIR), so it is possible that there are some regressions.

Arnout? :-)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw
Quoted 21 lines · Thomas Petazzoni

Hello,

Quoted 17 lines · Mark Jackson

I can successfully compile "beaglebone_defconfig".

$ make clean
$ make beaglebone_defconfig
$ make

And in output/host/usr/bin, I can find all the "arm-linux-xyz" cross compiler tools (gcc, strings, strip, etc).

But when I try to use these to compile my own code, I get an error as follows:-

$ which arm-linux-gcc
/home/mpfj/buildroot/output/host/usr/bin/arm-linux-gcc
$ arm-linux-gcc
/home/mpfj/buildroot/output/usr/bin/arm-linux-gcc.br_real: No such file or directory

Quite correctly, "output/usr/bin" doesn't exist ... the files are in "output/host/usr/bin"

Quoted 7 lines
Quoted 3 lines

arm-linux-gcc is just a symlink to toolchain-wrapper, so toolchain-wrapper seems to be pointing to the wrong directory!!

I'm sure was working yesterday, but I did a "git pull" this morning, so it may be something quite recent ??

We pushed some changes over the last few days that moved everything in $(HOST_DIR)/usr up into $(HOST_DIR), so it is possible that there are some regressions.

You need to rebuild the toolchain (actually the toolchain wrapper) after this
change. And probably other things need to be rebuilt as well. To be safe, do a "make clean; make".

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

Hello,

Quoted 23 lines · Arnout Vandecappelle
Quoted 23 lines · Mark Jackson
Quoted 21 lines

I can successfully compile "beaglebone_defconfig".

$ make clean
$ make beaglebone_defconfig
$ make

And in output/host/usr/bin, I can find all the "arm-linux-xyz" cross compiler tools (gcc, strings, strip, etc).

But when I try to use these to compile my own code, I get an error as follows:-

$ which arm-linux-gcc
/home/mpfj/buildroot/output/host/usr/bin/arm-linux-gcc
$ arm-linux-gcc
/home/mpfj/buildroot/output/usr/bin/arm-linux-gcc.br_real: No such file or directory

Quite correctly, "output/usr/bin" doesn't exist ... the files are in "output/host/usr/bin"

arm-linux-gcc is just a symlink to toolchain-wrapper, so toolchain-wrapper seems to be pointing to the wrong directory!!

I'm sure was working yesterday, but I did a "git pull" this morning, so it may be something quite recent ??

Quoted 7 lines
Quoted 3 lines

We pushed some changes over the last few days that moved everything in $(HOST_DIR)/usr up into $(HOST_DIR), so it is possible that there are some regressions.

You need to rebuild the toolchain (actually the toolchain wrapper) after this
change. And probably other things need to be rebuilt as well. To be safe, do a "make clean; make".

Re-read the original message from Mark: he starts by saying that he has done "make clean; make beaglebone_defconfig; make".

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 toolchain-wrapper: fix breakage after host/usr removal

The toolchain wrapper, when called through PATH, strips the last three levels of /proc/self/exe to find HOST_DIR. However, after the host/usr removal, this should be just two levels.

The toolchain wrapper has different logic for when it is called with a full path (i.e. $HOST_DIR/usr/bin/arm-linux-gcc) then when it is called through the PATH (i.e. just arm-linux-gcc). The latter is never used internally in Buildroot, that's why this wasn't discovered through testing.

---
Sorry for the breakage :-)

Note to self: add a test for calling the toolchain through PATH.

To fix an existing toolchain without rebuilding:
make host-gcc-final-rebuild
(or make host-toolchain-external-custom-rebuild if that's what you're using).

---
 toolchain/toolchain-wrapper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
toolchain/toolchain-wrapper.c +1 -1
index 3a4455ff82..a73e6d6f94 100644
@@ -192,7 +192,7 @@ int main(int argc, char **argv)
 		for (i = ret; i > 0; i--) {
 			if (absbasedir[i] == '/') {
 				absbasedir[i] = '\0';
-				if (++count == 3)
+				if (++count == 2)
 					break;
 			}
 		}
Signature · 1 line
2.13.2
#5 lore raw

PATCH 1/1 toolchain-wrapper: fix breakage after host/usr removal

Quoted 4 lines · Arnout Vandecappelle (Essensium/Mind)

The toolchain wrapper, when called through PATH, strips the last three levels of /proc/self/exe to find HOST_DIR. However, after the host/usr removal, this should be just two levels.

Quoted 8 lines

The toolchain wrapper has different logic for when it is called with a full path (i.e. $HOST_DIR/usr/bin/arm-linux-gcc) then when it is called through the PATH (i.e. just arm-linux-gcc). The latter is never used internally in Buildroot, that's why this wasn't discovered through testing.

Works fine now. Cheers.

Quoted 27 lines

---
Sorry for the breakage :-)

Note to self: add a test for calling the toolchain through PATH.

To fix an existing toolchain without rebuilding:
make host-gcc-final-rebuild
(or make host-toolchain-external-custom-rebuild if that's what you're using).

---
  toolchain/toolchain-wrapper.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
toolchain/toolchain-wrapper.c +1 -1
index 3a4455ff82..a73e6d6f94 100644
@@ -192,7 +192,7 @@ int main(int argc, char **argv)
  		for (i = ret; i > 0; i--) {
  			if (absbasedir[i] == '/') {
  				absbasedir[i] = '\0';
-				if (++count == 3)
+				if (++count == 2)
  					break;
  			}
  		}
#6 lore raw

PATCH 1/1 toolchain-wrapper: fix breakage after host/usr removal

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello,

Quoted 10 lines · Arnout Vandecappelle (Essensium/Mind)

The toolchain wrapper, when called through PATH, strips the last three levels of /proc/self/exe to find HOST_DIR. However, after the host/usr removal, this should be just two levels.

The toolchain wrapper has different logic for when it is called with a full path (i.e. $HOST_DIR/usr/bin/arm-linux-gcc) then when it is called through the PATH (i.e. just arm-linux-gcc). The latter is never used internally in Buildroot, that's why this wasn't discovered through testing.

Quoted 4 lines

---
Sorry for the breakage :-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw
In reply to Arnout Vandecappelle

Hey Arnout,

Quoted 28 lines · Arnout Vandecappelle
Quoted 25 lines · Thomas Petazzoni

Hello,

Quoted 20 lines · Mark Jackson

I can successfully compile "beaglebone_defconfig".

$ make clean
$ make beaglebone_defconfig
$ make

And in output/host/usr/bin, I can find all the "arm-linux-xyz" cross compiler tools (gcc, strings, strip, etc).

But when I try to use these to compile my own code, I get an error as follows:-

$ which arm-linux-gcc
/home/mpfj/buildroot/output/host/usr/bin/arm-linux-gcc
$ arm-linux-gcc
/home/mpfj/buildroot/output/usr/bin/arm-linux-gcc.br_real: No such file or directory

Quite correctly, "output/usr/bin" doesn't exist ... the files are in "output/host/usr/bin"

arm-linux-gcc is just a symlink to toolchain-wrapper, so toolchain-wrapper seems to be pointing to the wrong directory!!

I'm sure was working yesterday, but I did a "git pull" this morning, so it may be something quite recent ??

Quoted 7 lines
Quoted 3 lines

We pushed some changes over the last few days that moved everything in $(HOST_DIR)/usr up into $(HOST_DIR), so it is possible that there are some regressions.

You need to rebuild the toolchain (actually the toolchain wrapper) after this
change. And probably other things need to be rebuilt as well. To be safe, do a "make clean; make".

Now I wonder, is there any difference to doing "make clean all"?

Quoted 3 lines

Regards,
Arnout

Best wishes,
Marcus

#8 lore raw
Quoted 3 lines · Marcus Hoffmann

Hey Arnout,

On 06.07.2017 23:50, Arnout Vandecappelle wrote:

[snip]

Quoted 5 lines
Quoted 3 lines

You need to rebuild the toolchain (actually the toolchain wrapper) after this
change. And probably other things need to be rebuilt as well. To be safe, do a "make clean; make".

Now I wonder, is there any difference to doing "make clean all"?

That should indeed be the same.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF