0

I am new to Buildroot (using 2021.02.5 version on Ubuntu on a Virtual Machine) and trying to compile an OS for my ZedBorad (ARM processor) during my internship.

I followed the tutorial that was given to me to do so but I still can't get make to work without printing any error.... :(

I configured what I want that way :

  • Kernel > Linux Kernel disabled
  • Bootloader > U-Boot disabled
  • Toolchain > C library = glibc
  • Target Packages > python3, xml module, python-lxml and python-numpy all selected
  • Networking Applications > dhcpcd and dropbear selected

Right now, what is returned to me are errors due to undefined reference to ... : More precisely, the end of my logs after running make is as follows :

/home/ouriacc/workspace/Buildroot/build-zb/host/lib/gcc/arm-buildroot-linux-gnueabihf/9.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/ouriacc/workspace/Buildroot/build-zb/build/glibc-2.32-50-g737efa27fca5c97f566a2005687fda7d6659cd2e/build/elf/librtld.os: in function `fdopendir':
(.text+0x1a89c): undefined reference to `__GI___fxstat64'
/home/ouriacc/workspace/Buildroot/build-zb/host/lib/gcc/arm-buildroot-linux-gnueabihf/9.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: (.text+0x1a8c0): undefined reference to `__GI___fcntl64_nocancel'
/home/ouriacc/workspace/Buildroot/build-zb/host/lib/gcc/arm-buildroot-linux-gnueabihf/9.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/ouriacc/workspace/Buildroot/build-zb/build/glibc-2.32-50-g737efa27fca5c97f566a2005687fda7d6659cd2e/build/elf/ld.so.new: hidden symbol `__getpid' isn't defined
/home/ouriacc/workspace/Buildroot/build-zb/host/lib/gcc/arm-buildroot-linux-gnueabihf/9.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:566 : /home/ouriacc/workspace/Buildroot/build-zb/build/glibc-2.32-50-g737efa27fca5c97f566a2005687fda7d6659cd2e/build/elf/ld.so] Erreur 1
make[3]: *** [Makefile:470 : elf/subdir_lib] Erreur 2
make[2]: *** [Makefile:9 : all] Erreur 2
make[1]: *** [package/pkg-generic.mk:250 : /home/ouriacc/workspace/Buildroot/build-zb/build/glibc-2.32-50-g737efa27fca5c97f566a2005687fda7d6659cd2e/.stamp_built] Erreur 2
make: *** [Makefile:23 : _all] Erreur 2

I read several threads on forums about this error but I still can't figure out exactly what I should do in my case. For what I understand, there is a problem with my ld.so library and I should add something to remove or fix this error in a Makefile but I don't know what to write, where to write it and even which Makefile I should edit (as there are at least 2)...

Does anybody has an answer or another solution to help me please ?

Lalastro
  • 151
  • 2
  • 10
  • Hello again! I wondered if you had any more information on your issue or maybe a configuration file handy? A potential issue, is that you need a rebuild, because you made changes to your toolchain. To make new toolchain features rebuild, you need to run `make clean` which will recompile the toolchain + everything else and redownload everything. Also, you could try changing your C library and check if it changes anything. (You can choose for example uClib, and give it a try.) Don't forgot to run `make clean` before `make` ! – Bastien Bastien Oct 04 '21 at 17:00
  • Also do you have a link to a tutorial you are using? ( because you mentioned in your other thread you used a tutorial. Are you still doing so?) Or a git where you have your buildroot files. It could help debugging and I could spend a little bit of time debugging it myself! – Bastien Bastien Oct 04 '21 at 17:02

1 Answers1

-1

It seems that you use an external toolchain. Try to set LD_LIBRARY_PATH environment variable for your toolchain. For example:

export LD_LIBRARY_PATH="/opt/x86-64-core-i7--glibc--stable-2020.08-1/x86_64-buildroot-linux-gnu/lib64:$LD_LIBRARY_PATH"

in your case possible the following will be suitable:

export LD_LIBRARY_PATH="/home/ouriacc/workspace/Buildroot/build-zb/host/lib/gcc/arm-buildroot-linux-gnueabihf/9.4.0/../../../../arm-buildroot-linux-gnueabihf/lib64:$LD_LIBRARY_PATH"

You may do that in docker, if you use one or in the your shell environment.

  • Thank you for your answer. I don't think I use an external toolchain, or if I do I am not aware of it... Is it possible ? I'm not familiar with those concepts yet (toolchain, image, cross compiler....). But I am sure to have downloaded nothing except buildroot and packages, so I shouldn't have an external toolchain, should I ? – Lalastro Oct 04 '21 at 09:24
  • Sorry, I think I'm wrong. Is /home/ouriacc/workspace/Buildroot/build-zb your buildroot mapping directory? Also It is possible that you use arm toolchain version instead of AArch64 one. – Boris Uskov Oct 04 '21 at 09:53
  • Yes, indeed it's my buildroot maping directory (I created a build-zb repository for my ZedBoard to have all the generated files in this instead of the buildroot 2021.02.5 repository. After some investigation about it, I am now certain I didn't use an external toolchain. To try to understand what went wrong, I restarted a compilation with the same configuration and in parallel I launched a compilation test where I let the default configuration, which just ended witout an error (for the first time !) I'm now waiting for the personnally configured one to end to see if I still get the same error – Lalastro Oct 04 '21 at 12:08
  • 1
    I'm sorry to say so, but this suggestion is very, very bad. Do not fiddle with LD_LIBRARY_PATH. – Thomas Petazzoni Oct 05 '21 at 07:14