binutils-esp32ulp icon indicating copy to clipboard operation
binutils-esp32ulp copied to clipboard

Compilation Error

Open giailang opened this issue 3 years ago • 1 comments

typecast error in make process: libbfd.h:268:4: error: cast between incompatible function types from ‘bfd_boolean (*)(bfd )’ {aka ‘int ()(bfd )’} to ‘bfd_boolean ()(bfd *, bfd )’ {aka ‘int ()(bfd *, bfd *)’} [-Werror=cast-function-type] gcc --version gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0

giailang avatar Aug 25 '21 06:08 giailang

Hey @giailang,

I also had this issue with gcc 9.3.0 on Ubuntu 20.04 (on a Raspberry Pi 4). My solution was the following:

  1. Checkout this repository recursively (git clone --recursive https://github.com/espressif/binutils-esp32ulp)
  2. Use gcc 7 instead of gcc 9 (sudo apt install gcc-7)
  3. Use g++ 7 instead of g++ 9 (sudo apt install g++-7)
  4. Set gcc 7 and g++ 7 to be the defaults (sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7, sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7)
  5. Re-run ./configure and make -j4
  6. Run make install

Remember to reset your gcc version to your previous value after compilation is complete.

Cheers

MihaiBojescu avatar Oct 17 '21 10:10 MihaiBojescu