My previously working Docker build started throwing this error, using a clone of the sources obtained yesterday:
make[2]: Entering directory `/opt/nodemcu-firmware/tools/spiffsimg'
gcc -g -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -I. -I../../app/
spiffs -I../../app/include -DNODEMCU_SPIFFS_NO_INCLUDE --include spiffs_typedefs
.h main.c ../../app/spiffs/spiffs_cache.c ../../app/spiffs/spiffs_check.c ../../
app/spiffs/spiffs_gc.c ../../app/spiffs/spiffs_hydrogen.c ../../app/spiffs/spiff
s_nucleus.c -o spiffsimg
make[2]: gcc: Command not found
make[2]: *** [spiffsimg] Error 127
make[2]: Leaving directory `/opt/nodemcu-firmware/tools/spiffsimg'
make[1]: *** [spiffsimg/spiffsimg] Error 2
make[1]: Leaving directory `/opt/nodemcu-firmware/tools'
make: *** [spiffs-image-remove] Error 2
Older clones of the source still build without errors.
It does build 0x00000.bin and 0x10000.bin using the latest sources, but doesn't build nodemcu_float_master_########-####.bin nor nodemcu_integer_master_########-####.bin.
Has anyone else ran into this?
You're using an older version of the Docker image. gcc was added to it two months ago. So, run
docker pull marcelstoer/nodemcu-build
to pull the latest version from Docker Hub. Docker doesn't automatically ensure you have the latest version if you downloaded the image before.
Related
Running ubuntu with 5.3 kernel.
/usr/bin/ld: /usr/local/lib/libavcodec.a(vc1dsp_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pw_9' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:307: recipe for target 'lib/libopencv_videoio.so.3.4.0' failed
make[2]: *** [lib/libopencv_videoio.so.3.4.0] Error 1
CMakeFiles/Makefile2:8259: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
Also:
ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1) 2.27
gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Any ideas ?
I'm getting this While compiling Openwrt SDK with "make V=99":
Making all in examples
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/examples'
make[6]: Nothing to be done for 'all'.
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/examples'
Making all in lib
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
make all-am
make[7]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
x86_64-linux-gnu-gcc -std=gnu99 -I. -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT gl_avltree_oset.o -MD -MP -MF .deps/gl_avltree_oset.Tpo -c -o gl_avltree_oset.o gl_avltree_oset.c
mv -f .deps/gl_avltree_oset.Tpo .deps/gl_avltree_oset.Po
x86_64-linux-gnu-gcc -std=gnu99 -I. -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT c-stack.o -MD -MP -MF .deps/c-stack.Tpo -c -o c-stack.o c-stack.c
mv -f .deps/c-stack.Tpo .deps/c-stack.Po
x86_64-linux-gnu-gcc -std=gnu99 -I. -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT clean-temp.o -MD -MP -MF .deps/clean-temp.Tpo -c -o clean-temp.o clean-temp.c
In file included from clean-temp.h:22:0,
from clean-temp.c:23:
./stdio.h:456:1: error: 'gets' undeclared here (not in a function)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
^
Makefile:1279: recipe for target 'clean-temp.o' failed
make[7]: *** [clean-temp.o] Error 1
make[7]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
Makefile:1083: recipe for target 'all' failed
make[6]: *** [all] Error 2
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
Makefile:1023: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Makefile:976: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Makefile:32: recipe for target '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/.built' failed
make[3]: *** [/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/.built] Error 2
make[3]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/tools/m4'
tools/Makefile:112: recipe for target 'tools/m4/compile' failed
make[2]: *** [tools/m4/compile] Error 2
make[2]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt'
tools/Makefile:111: recipe for target '/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/stamp/.tools_install_nnynn' failed
make[1]: *** [/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/stamp/.tools_install_nnynn] Error 2
make[1]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt'
/home/ghanem/Documents/openwrtsdk/openwrt/include/toplevel.mk:138: recipe for target 'world' failed
make: *** [world] Error 2
ghanem#ghanem-VGN-BZ31XT:~/Documents/openwrtsdk/openwrt$ clear
ghanem#ghanem-VGN-BZ31XT:~/Documents/openwrtsdk/openwrt$ make V=99
make[1]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt'
make[2]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt'
+ mkdir -p /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32
+ cd /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32
+ mkdir -p bin lib include stamp
mkdir -p /home/ghanem/Documents/openwrtsdk/openwrt/build_dir/target-mipsel_r2_uClibc-0.9.32/stamp
touch /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/.prepared
+ mkdir -p /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host
+ cd /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host
+ mkdir -p bin lib include stamp
mkdir -p /home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/stamp
install -m0644 /home/ghanem/Documents/openwrtsdk/openwrt/tools/include/*.h /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include/
touch /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/.prepared
make[3]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/tools/m4'
make -C /home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15
make[4]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
make all-recursive
make[5]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Making all in .
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
make[6]: Nothing to be done for 'all-am'.
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Making all in examples
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/examples'
make[6]: Nothing to be done for 'all'.
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/examples'
Making all in lib
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
make all-am
make[7]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
x86_64-linux-gnu-gcc -std=gnu99 -I. -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT gl_avltree_oset.o -MD -MP -MF .deps/gl_avltree_oset.Tpo -c -o gl_avltree_oset.o gl_avltree_oset.c
mv -f .deps/gl_avltree_oset.Tpo .deps/gl_avltree_oset.Po
x86_64-linux-gnu-gcc -std=gnu99 -I. -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT c-stack.o -MD -MP -MF .deps/c-stack.Tpo -c -o c-stack.o c-stack.c
mv -f .deps/c-stack.Tpo .deps/c-stack.Po
x86_64-linux-gnu-gcc -std=gnu99 -I. -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT clean-temp.o -MD -MP -MF .deps/clean-temp.Tpo -c -o clean-temp.o clean-temp.c
In file included from clean-temp.h:22:0,
from clean-temp.c:23:
./stdio.h:456:1: error: 'gets' undeclared here (not in a function)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
^
Makefile:1279: recipe for target 'clean-temp.o' failed
make[7]: *** [clean-temp.o] Error 1
make[7]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
Makefile:1083: recipe for target 'all' failed
make[6]: *** [all] Error 2
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
Makefile:1023: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Makefile:976: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Makefile:32: recipe for target '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/.built' failed
make[3]: *** [/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/.built] Error 2
make[3]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/tools/m4'
tools/Makefile:112: recipe for target 'tools/m4/compile' failed
make[2]: *** [tools/m4/compile] Error 2
make[2]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt'
tools/Makefile:111: recipe for target '/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/stamp/.tools_install_nnynn' failed
make[1]: *** [/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/stamp/.tools_install_nnynn] Error 2
make[1]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt'
/home/ghanem/Documents/openwrtsdk/openwrt/include/toplevel.mk:138: recipe for target 'world' failed
make: *** [world] Error 2
Anyone know if this is a common occurrence? And if so how can I get past it? I've already read about "fixes", like this one: (https://dev.openwrt.org/attachment/ticket/12005/stdio.patch) But how can I use this fix and where should I copy-paste it?
ok, I was able to get past this error but I was welcomed with a truckload of others. Anyway, here's how you get past it:
open the file “build_dir/host/m4-1.4.16/lib/stdio.h” in a text editor, then search for “_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);” and replace it with the following line.
#define gets(a) fgets( a, sizeof(*(a)), stdin);
save and close.
You'll now have another folder named bison-2.4.3 in build_dir/host. Go to /build_dir/host/bison-2.4.3/lib/stdio.h and do the same thing. That's it.
Right after this, you'll run into a "elf.cpp: In static member function 'static Elf::file* Elf::file::open(const char*)'"
All you need to do to get past this error is by opening the file "elf.cpp" in /build_dir/host/mklibs/src/mklibs-readelf and add:
#include <unistd.h>
That should get you past it.
I'm Trying to install OpenCV on Ubuntu 14.10 but i'm facing this error again and again :(
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:654: recipe for target 'lib/libopencv_highgui.so.2.4.9' failed
make[2]: *** [lib/libopencv_highgui.so.2.4.9] Error 1
CMakeFiles/Makefile2:1767: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
Makefile:133: recipe for target 'all' failed
make: *** [all] Error 2
Please provide the command history before you have encountered the error.
If calling make was the last thing before the error occured, you can try to call make CFLAGS="-fPIC" instead.
Late to the party, but the issue is that FFMPEG is not compiled with position-independent code. Go to your FFMPEG directory and do
./configure --enable-nonfree --enable-pic --enable-shared
then redo the make, make install steps, and re-do the build of opencv.
When I svn co llvm-3.3,clang-3.3,compiler -rt, build passes but build didn't create clang exe in build/Debug+Asserts. When I put only clang for svn co build didn't pass but he creates clang exe. I'm Linux user on Ubuntu.
make[4]: Leaving directory `/home/rtrk/llvm/test/branches_release/release_33-build/tools/clang/runtime/compiler-rt'
make[3]: *** [compiler-rt/.makeall] Error 2
make[3]: Leaving directory `/home/rtrk/llvm/test/branches_release/release_33-build/tools/clang/runtime'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/home/rtrk/llvm/test/branches_release/release_33-build/tools/clang'
make[1]: *** [clang/.makeall] Error 2
make[1]: Leaving directory `/home/rtrk/llvm/test/branches_release/release_33-build/tools'
export JN
export JN='-j 8'
rm -rf llvm34
svn co http://llvm.org/svn/llvm-project/llvm/branches/release_34/ llvm34
cd llvm34
cd tools
svn co http://llvm.org/svn/llvm-project/cfe/branches/release_34/ clang
cd ..
./configure --enable-optimized --disable-doxygen --prefix=/opt/llvm34
make $JN
make install
I know OpenCV 3.0 is not a release version, yet. I'm trying to evaluate a few features in the 3.0 version for a prototype system we are building. I cloned the latest source code from the git repository and I use the following cmake to build the libraries:
cmake -D BUILD_SHARED_LIBS=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
However, I encounter this issue when it builds the libraries when i do a make:
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libopencv_highgui.so.3.0.0] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
I'm not quite sure where to set the -fPIC flag in the CMakeLists.txt. Just a point to note, I have OpenCV 2.4.8 libraries already built and running on my machine. Thanks for taking time to help me out!
Thanks for the answer. I managed to install OpenCV 3.0.0-dev version by removing my existing OpenCV installation. Although this was not required, I removed my previous 2.4.8 library files and managed to compile it. CCMake helped make the decision for the installation much simpler. Use that to decide which libraries you'd like to compile before running make.