espressif / binutils-esp32ulp

Binutils fork with support for the ESP32 ULP co-processor
GNU General Public License v2.0
46 stars 18 forks source link

Compilation Error #19

Open giailang opened 3 years ago

giailang commented 3 years ago

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

MihaiBojescu commented 3 years ago

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