crosstool-NG icon indicating copy to clipboard operation
crosstool-NG copied to clipboard

Build fails with ESP32

Open Chandler-Kluser opened this issue 6 months ago • 0 comments

Build Steps

git clone https://github.com/jcmvbkbc/crosstool-NG.git -b xtensa-fdpic
cd crosstool-NG/
./bootstrap && ./configure --enable-local && make
./ct-ng xtensa-esp32-linux-uclibcfdpic
CT_PREFIX=`pwd`/builds nice ./ct-ng build

Output

$ CT_PREFIX=`pwd`/builds nice ./ct-ng build
[INFO ]  Performing some trivial sanity checks
[WARN ]  Number of open files 1024 may not be sufficient to build the toolchain; increasing to 2048
[INFO ]  Build started 20240106.061549
[INFO ]  Building environment variables
[WARN ]  Directory '/home/vm/src' does not exist.
[WARN ]  Will not save downloaded tarballs to local storage.
[EXTRA]  Preparing working directories
[ERROR]    collect2: error: ld returned 1 exit status
[ERROR]   
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Checking that gcc can statically link libstdc++ (CT_WANTS_STATIC_LINK_CXX)'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@377]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@627]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      https://crosstool-ng.github.io/docs/known-issues/
[ERROR]  >>
[ERROR]  >> NOTE: Your configuration includes features marked EXPERIMENTAL.
[ERROR]  >> Before submitting a bug report, try to reproduce it without enabling
[ERROR]  >> any experimental features. Otherwise, you'll need to debug it
[ERROR]  >> and present an explanation why it is a bug in crosstool-NG - or
[ERROR]  >> preferably, a fix.
[ERROR]  >>
[ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
[ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
[ERROR]  >>
[ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
[ERROR]  >>  Read the bug reporting guidelines here:
[ERROR]  >>      http://crosstool-ng.github.io/support/
[ERROR]   
[ERROR]  (elapsed: 0:00.99)
[00:01] / gmake: *** [ct-ng:261: build] Error 1

Workarounds tried

$ diff .config_old .config
49c49
< CT_LOCAL_TARBALLS_DIR="${HOME}/src"
---
> CT_LOCAL_TARBALLS_DIR="${HOME}/esp32-linux/build/crosstool-NG/.build/xtensa-esp32-linux-uclibcfdpic/src"
495c495
< CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/xtensa-esp32s3-linux-uclibcfdpic/uclibc.config"
---
> CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/xtensa-esp32-linux-uclibcfdpic/uclibc.config"

Environment

Ubuntu 22.04 LTS with these packages:

  • git
  • autoconf
  • make
  • cmake
  • flex
  • texinfo
  • help2man
  • gawk
  • libtool
  • libtool-bin
  • bison
  • libncurses5-dev
  • libstdc++-10-dev
  • libstdc++-10-dev-amd64-cross

Known Issues

  1. EXPERIMENTAL_FEATURES is on
  2. gcc can be successfully built (with link errors) in esp32s3 configuration

Besides that, Linking Error does not mean gcc (and build tools) were not compiled for esp32

Chandler-Kluser avatar Jan 06 '24 09:01 Chandler-Kluser