Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail to make cross compiler #1272

Closed
JenniferBrana opened this issue Jun 11, 2023 · 6 comments
Closed

fail to make cross compiler #1272

JenniferBrana opened this issue Jun 11, 2023 · 6 comments

Comments

@JenniferBrana
Copy link

Hi,
I have been attempting to make both elf-gcc and linux-gcc. Both fail to build with the same error messages.

My environment: Ubuntu 18.04.4 LTS, GCC version: 7.5.0.

After a long compile time, I received the error below. Does anyone know how to resolve this?

make[5]: Entering directory '/h/jbrana/riscv/riscv-gnu-toolchain/build-binutils-linux/ld'
GEN configdoc.texi
MAKEINFO ld.info
/h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ld.texi:903: warning: @pxref node name should not contain .' /h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ld.texi:9049: warning: @pxref node name should not contain .'
CC libdep_plugin.lo
GEN libdep.la
libtool: link: warning: ignoring multiple `-rpath's for a libtool library
CC libldtestplug_la-testplug.lo
CCLD libldtestplug.la
CC libldtestplug2_la-testplug2.lo
CCLD libldtestplug2.la
CC libldtestplug3_la-testplug3.lo
CCLD libldtestplug3.la
CC libldtestplug4_la-testplug4.lo
CCLD libldtestplug4.la
CC ldgram.o
LEX ldlex.c
CC ldlex-wrapper.o
In file included from /h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex-wrapper.c:26:0:
/h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex.l: In function ‘yyrestart’:
/h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex.l:937:17: warning: unused variable ‘new_state_buf’ [-Wunused-variable]
/h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex.l:936:10: warning: unused variable ‘new_size’ [-Wunused-variable]
/h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex.l: In function ‘yy_switch_to_buffer’:
/h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex.l:965:17: warning: unused variable ‘new_state_buf’ [-Wunused-variable]
/h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex.l:964:10: warning: unused variable ‘new_size’ [-Wunused-variable]
In file included from /h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex-wrapper.c:26:0:
/h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex.l: In function ‘yy_create_string_buffer’:
/h/jbrana/riscv/riscv-gnu-toolchain/binutils/ld/ldlex.l:544:6: error: ‘struct yy_buffer_state’ has no member named ‘yy_at_bol’; did you mean ‘yyatbol’?
b->yy_fill_buffer = 0;
^~~~~~~~~
yyatbol
Makefile:2229: recipe for target 'ldlex-wrapper.o' failed
make[5]: *** [ldlex-wrapper.o] Error 1
make[5]: Leaving directory '/h/jbrana/riscv/riscv-gnu-toolchain/build-binutils-linux/ld'
Makefile:1835: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/h/jbrana/riscv/riscv-gnu-toolchain/build-binutils-linux/ld'
Makefile:1073: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/h/jbrana/riscv/riscv-gnu-toolchain/build-binutils-linux/ld'
Makefile:8159: recipe for target 'all-ld' failed
make[2]: *** [all-ld] Error 2
make[2]: Leaving directory '/h/jbrana/riscv/riscv-gnu-toolchain/build-binutils-linux'
Makefile:1004: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/h/jbrana/riscv/riscv-gnu-toolchain/build-binutils-linux'
Makefile:317: recipe for target 'stamps/build-binutils-linux' failed
make: *** [stamps/build-binutils-linux] Error 2

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Jun 11, 2023

Please provide full details on how your building the tools for both cases.

  1. git clone command lines
  2. configure command line
  3. make command lines

I built both the bare metal/newlib and Linux toolchains (on Zorin OS Lite 16.2 - a Ubuntu 20.04 LTS derivative) recently (last week) with no issues.

git clone https://github.com/riscv-collab/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=`pwd`/newlib-installed-tools
make newlib 
make distclean
./configure --prefix=`pwd`/linux-installed-tools
make linux

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Jun 11, 2023

My environment: Ubuntu 18.04.4 LTS, GCC version: 7.5.0.

GCC 7.5.0 is very old.

Even if it's not the cause of your problems you should probably compile the RISC-V tools with a more recent host toolchain.

@TommyMurphyTM1234
Copy link
Collaborator

I'm just trying my build instructions above on a clean Ubuntu 18.04 virtual machine and will post back with results as soon as I can.

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Jun 12, 2023

OK - the newlib toolchain build succeeded.

I installed a fresh Ubuntu 18.04 VirtualBox virtual machine, installed all available updates, installed the VirtualBox guest additions, installed the riscv-gnu-toolchain build prerequisites plus git, and then ran the following:

cd ~/Downloads
git clone https://github.com/riscv-collab/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=`pwd`/newlib-installed-tools
date > make-newlib.log && make newlib 2>&1 | tee -a make-newlib.log && date >> make-newlib.log

Compressed build log: make-newlib.zip

I'll try the Linux toolchain build now.

But it looks like the issue may be with your host setup or something.

@TommyMurphyTM1234
Copy link
Collaborator

The Linux toolchain also built fine for me.

Compressed build log: make-linux.zip

So I cannot reproduce the issue on a clean Ubuntu 18.04 installation.

@TommyMurphyTM1234
Copy link
Collaborator

Invalid issue - not reproducible.

@TommyMurphyTM1234 TommyMurphyTM1234 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants