cc: error: unknown argument: '-fformat-extensions' - gcc

I am posting a question because of the problem:
cc: error: unknown argument: '-fformat-extensions'
The following error occurred while compiling FreeBSD src with gcc.
Below is a log.
--------------------------------------------------------------
>>> stage 3.1: making dependencies
--------------------------------------------------------------
cc: error: unknown argument: '-fformat-extensions'
--- vmx_genassym.o ---
*** [vmx_genassym.o] Error code 1
make[4]: stopped in /usr/KRSense/tmp/FreeBSD-src/sys/modules/vmm
1 error
make[4]: stopped in /usr/KRSense/tmp/FreeBSD-src/sys/modules/vmm
--- depend_subdir_vmm ---
*** [depend_subdir_vmm] Error code 2

The FreeBSD system compiler has customer patches which adds the (curiously named) -fformat-extensions option:
Why can't lang/gcc4X compilers build kernel modules?
You will have to use the system compiler or another compiler which has been patched in the same way.

Related

What is causing this emscripten build to fail?

I am using the following cmd to build a wasm using emscripten:
npm run build
It gets so far through before failing during the configure:
configure: make -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threads
make: invalid option -- 'D'
make: invalid option -- 'D'
Producing a final error:
This program built for x86_64-pc-linux-gnu
Report bugs to <bug-make#gnu.org>
emcmake: error: 'make -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threads' failed (returned 2)
make: *** [Makefile:84: build/popt/.libs/libpopt.a] Error 1
What is going wrong?
Update using cmake instead of make produces this error:
configure: cmake -DCMAKE_TOOLCHAIN_FILE=/home/user1/Downloads/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/home/user1/Downloads/emsdk/node/14.18.2_64bit/bin/node;--experimental-wasm-threads
CMake Warning:
No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases.
CMake Error: The source directory "/home/user1/Downloads/test1.js-master/build/popt" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
emcmake: error: 'cmake -DCMAKE_TOOLCHAIN_FILE=/home/user1/Downloads/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/home/user1/Downloads/emsdk/node/14.18.2_64bit/bin/node;--experimental-wasm-threads' failed (returned 1)
make: *** [Makefile:84: build/popt/.libs/libpopt.a] Error 1

class_loader failed when cross compiling ROS Melodic for aarch64 with buildroot

I'm trying to cross compiling ROS Melodic for aarch64 on raspberry pi 3 with toolchain that created by buildroot.
I followed the document http://wiki.ros.org/ROS/CrossCompiling/RaspberryPi/Cross-Compile%20ROS%20for%20the%20RaspberryPi, the source of ROS I try to build comes from:
rosinstall_generator ros_comm --rosdistro melodic --deps --tar > melodic-ros_comm.rosinstall
wstool init -j8 src melodic-ros_comm.rosinstall
And I got the error messages like these:
[100%] Linking CXX shared library /home/developer/ros_pi/ros_catkin_ws/devel_isolated/class_loader/lib/libclass_loader.so
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/aarch64-buildroot-linux-gnu/8.4.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /home/developer/buildroot-2020.02.1/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libboost_thread.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
CMakeFiles/class_loader.dir/build.make:180: recipe for target '/home/developer/ros_pi/ros_catkin_ws/devel_isolated/class_loader/lib/libclass_loader.so' failed
make[2]: *** [/home/developer/ros_pi/ros_catkin_ws/devel_isolated/class_loader/lib/libclass_loader.so] Error 1
CMakeFiles/Makefile2:195: recipe for target 'CMakeFiles/class_loader.dir/all' failed
make[1]: *** [CMakeFiles/class_loader.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'class_loader':
Command '['/home/developer/ros_pi/ros_catkin_ws/install_isolated/env.sh', 'make', '-j8', '-l8']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/developer/ros_pi/ros_catkin_ws/build_isolated/class_loader && /home/developer/ros_pi/ros_catkin_ws/install_isolated/env.sh make -j8 -l8
Command failed, exiting.
This is my toolchain.cmake:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_LIBRARY_ARCHITECTURE aarch64)
set( CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/home/developer/buildroot-2020.02.1/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/")
set( CMAKE_C_COMPILER aarch64-linux-gcc)
set( CMAKE_CXX_COMPILER aarch64-linux-g++)
set(CMAKE_FIND_ROOT_PATH "/home/developer/buildroot-2020.02.1/output/host/aarch64-buildroot-linux-gnu/sysroot")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
include_directories(/home/developer/buildroot-2020.02.1/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/)
I guess the problem comes from boost?
The version of boost which I used is 1.65.1
All the steps I tried is contained in Dockerfile as link as below:
https://github.com/i-am-neet/cc-ros/blob/master/Dockerfile
Thank you for your patience

Building Artery on Ubuntu fails

When I try to build Artery on Ubuntu 16.04. the following happens after invoking
$ cmake --build /home/hardt/Veins/artery-master/build
[ 23%] Linking CXX shared library libartery.so
/usr/bin/ld: /usr/local/lib/libvanetza_btp.a(data_request.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared
object; recompile with -fPIC
/usr/local/lib/libvanetza_btp.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
src/artery/CMakeFiles/artery.dir/build.make:954: recipe for target'src/artery/libartery.so' failed
make[2]: *** [src/artery/libartery.so] Error 1
CMakeFiles/Makefile2:229: recipe for target 'src/artery/CMakeFiles/artery.dir/all' failed
make[1]: *** [src/artery/CMakeFiles/artery.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
As I am not all that familiar with building source on Unix systems I am not quite sure how to deal with this error.
I am using cmake version 3.9.3, boost 1.65.1 and crypto++ 5.6.4 the geographiclib built without error as well.
As one can read in the comments, the problem is solved.
The path to the vanetza directory VANETZA_DIR in the cmake configuration was wrong. Correcting this via ccmake solved the problem.

DSO missing from command line Compiling TrueCrypt

I've been trying to compile truecrypt 7.1a on Debian Jessie 8.1.0 AMD64 for the past two days now. I have wxGTK2.8.12 source because Debian Jessie only have v3.0 packages. That's a problem because wxwidgets3.0 has protected wxstandardpaths so you have to use wxstandardpaths::get and truecrypt uses wxstandardpaths in application.cpp for example and it would return an error while compiling.
I'm not sure how to fix that so I went to option 2 compile wxgtk2.8.12 source using the truecrypt compile option # make WX_ROOT=/usr/src/truecrypt-7.1a-source/wxGTK-2.8.12 wxbuild. That completes then I do # make WXSTATIC=1 and I run into this error below. Even if I compile and install wxwidgets-2.8.12 myself I get this error. Maybe it's a x11lib issue?
^
Linking truecrypt
/usr/bin/ld:
/usr/src/truecrypt-7.1a-source/wxrelease/lib/libwx_gtk2u_core-2.8.a(corelib_utilsx11.o): undefined reference to symbol 'XGetWindowAttributes'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO
missing from command line collect2: error: ld returned 1 exit status
Main.make:107: recipe for target 'truecrypt' failed make[1]: ***
[truecrypt] Error 1 Makefile:268: recipe for target 'all' failed make:
*** [all] Error 2

'make' mdrpdt(a software) on Mac OS X

jcykdeMacBook-Pro:mdrpdt-2.0.1.21 jcyk$ make
Building bin/lib/serial/APPLE-64bit/g++/libutility.a
clang: error: unknown argument: '-fforce-addr' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make[1]: *** [../../build/utility/serial/APPLE-g++/64bit/release/application.o] Error 1
make: *** [bin/lib/serial/APPLE-64bit/g++/libutility.a] Error 2
I got mdrpdt from http://ritchielab.psu.edu/software/mdr-download.
how can I do to fix this?
It looks like you just need to remove -fforce-addr from the invocation of clang, see example here where configure is patched.

Resources