esp-open-sdk icon indicating copy to clipboard operation
esp-open-sdk copied to clipboard

cross-gdb build fails

Open horvathp opened this issue 7 years ago • 13 comments

On OS X, with the latest master, [ERROR] /Volumes/ESPToolchain/esp-open-sdk/crosstool-NG/.build/src/gdb-7.10/gdb/guile/scm-ports.c:231:47: error: incomplete definition of type 'struct scm_t_port'

Is this a known issue?

horvathp avatar Apr 07 '17 12:04 horvathp

I have very similar issue on linux:

[ERROR]    /home/XXX/esp-open-sdk/crosstool-NG/.build/src/gdb-7.10/gdb/guile/scm-ports.c:681:19: error: 'SCM_PORT_NEITHER' undeclared (first use in this function)
[ERROR]    /home/XXX/esp-open-sdk/crosstool-NG/.build/src/gdb-7.10/gdb/guile/scm-ports.c:711:19: error: 'SCM_PORT_NEITHER' undeclared (first use in this function)
[ERROR]    /home/XXX/esp-open-sdk/crosstool-NG/.build/src/gdb-7.10/gdb/guile/scm-ports.c:790:24: error: 'SCM_PORT_WRITE' undeclared (first use in this function)
[ERROR]    /home/XXX/esp-open-sdk/crosstool-NG/.build/src/gdb-7.10/gdb/guile/scm-ports.c:816:29: error: 'SCM_PORT_READ' undeclared (first use in this function)
[ERROR]    make[5]: *** [Makefile:2469: scm-ports.o] Error 1
[ERROR]    make[4]: *** [Makefile:8755: all-gdb] Error 2
[ERROR]    make[3]: *** [Makefile:845: all] Error 2
[ERROR]  
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing cross-gdb'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR]  >>        called from: do_debug_gdb_build[scripts/build/debug/300-gdb.sh@120]
[ERROR]  >>        called from: do_debug[scripts/build/debug.sh@35]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@646]
[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]  >>      'share/doc/crosstool-ng/crosstool-ng-1.22.0-60-g37b07f6f/B - Known issues.txt'
[ERROR]  
[ERROR]  (elapsed: 13:22.15)


b3niup avatar May 02 '17 00:05 b3niup

Same. It seems to be due to this: https://sourceware.org/bugzilla/show_bug.cgi?id=21104 Edit: see also https://github.com/crosstool-ng/crosstool-ng/issues/718

little-dude avatar May 22 '17 18:05 little-dude

A reasonable workaround to get the rest of the build to succeed is disabling the gdb build. It can be done by adding the line

CT_DEBUG_gdb=n

to the file crosstool-config-overrides. A proper workaround would be to somehow pass --with-guile=guile-2.0 to the gdb configure script. I'll report if I figure out how to do that.

flannelhead avatar May 29 '17 09:05 flannelhead

Yep, it seems

CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-guile=guile-2.0"

did the trick and I was able to build also gdb. Ideally this situation should be detected on the crosstool-ng side, but this serves as a temporary workaround.

Notice that this might break the build for users with older guile. Guile 2.0 has been released in 2011 though, so this shouldn't be a major issue.

flannelhead avatar May 29 '17 09:05 flannelhead

Where did you put this line?

roger-zacharczyk avatar Nov 15 '17 13:11 roger-zacharczyk

In crosstool-config-overrides (which I mentioned in my comment right above).

flannelhead avatar Nov 15 '17 13:11 flannelhead

sorry, but where should I put that file, I couldn't find it. I'm following these steps: https://docs.espressif.com/projects/esp-idf/en/stable/get-started/macos-setup-scratch.html

but I couldn't find any crosstool-config-overrides in the ~/esp folder. Thanks!

ricardoquesada avatar Nov 08 '18 06:11 ricardoquesada

@ricardoquesada : you seem to be not using esp-open-sdk but building directly from crosstool-ng by Espressif's instructions. However, if you're getting the build failure, you can append the configuration line

CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-guile=guile-2.0"

to crosstool-ng's config file (located in the same folder as the ct-ng binary). Do this after running

./ct-ng xtensa-esp32-elf

but before

./ct-ng build

flannelhead avatar Nov 08 '18 20:11 flannelhead

thanks @flannelhead !

ricardoquesada avatar Nov 09 '18 05:11 ricardoquesada

I have guile 2.2 and using the following doesn't seem to fix the issue. Any idea? CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-guile=guile-2.2"

blasco avatar May 25 '19 21:05 blasco

@ricardoquesada : you seem to be not using esp-open-sdk but building directly from crosstool-ng by Espressif's instructions. However, if you're getting the build failure, you can append the configuration line

CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-guile=guile-2.0"

to crosstool-ng's config file (located in the same folder as the ct-ng binary). Do this after running

./ct-ng xtensa-esp32-elf

but before

./ct-ng build

how can i make this workaround work if i need the 106 compiler and not the 32 one ?

seems ct-ng doesn't have a rule for xtensa-esp106-elf

edit: Nevermind! i made a typo. just do: ./ct-ng xtensa-lx106-elf

ZweiEuro avatar Dec 19 '19 19:12 ZweiEuro

I have guile 2.2 and using the following doesn't seem to fix the issue. Any idea? CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-guile=guile-2.2"

For me (using Arch Linux) using guile-2.2 didn't work either. I just installed guile-2.0 and used this.

oceanites avatar Jan 02 '20 10:01 oceanites

I had the same error compiling with Ubuntu 20.04. Second fix from flannelhead (CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-guile=guile-2.0") did't work.

The first fix did the trick (CT_DEBUG_gdb=n)

hcet14 avatar Dec 18 '20 00:12 hcet14