binutils-esp32ulp
binutils-esp32ulp copied to clipboard
Compilation Error
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
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:
- Checkout this repository recursively (
git clone --recursive https://github.com/espressif/binutils-esp32ulp
) - Use gcc 7 instead of gcc 9 (
sudo apt install gcc-7
) - Use g++ 7 instead of g++ 9 (
sudo apt install g++-7
) - 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
) - Re-run
./configure
andmake -j4
- Run
make install
Remember to reset your gcc version to your previous value after compilation is complete.
Cheers