I'm trying to install node.js, so I've cloned the repo and ./configure it. However, when I run make I get this ridiculous infinite loop of errors:
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/home/ubuntu/nodejs/node/out'
g++ '-DOPENSSL_NO_SSL2=1' '-DV8_TARGET_ARCH_X64' '-DENABLE_DEBUGGER_SUPPORT' -I../deps/v8/src -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fno-strict-aliasing -m64 -O3 -ffunction-sections -fdata-sections -fno-tree-vrp -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -MMD -MF /home/ubuntu/nodejs/node/out/Release/.deps//home/ubuntu/nodejs/node/out/Release/obj.target/v8_base.x64/deps/v8/src/runtime.o.d.raw -c -o /home/ubuntu/nodejs/node/out/Release/obj.target/v8_base.x64/deps/v8/src/runtime.o ../deps/v8/src/runtime.cc
In file included from ../deps/v8/src/v8.h:52:0,
from ../deps/v8/src/runtime.cc:31:
../deps/v8/src/../include/v8.h: In member function ‘void v8::ReturnValue<T>::Set(uint32_t)’:
../deps/v8/src/../include/v8.h:5816:31: warning: typedef ‘I’ locally defined but not used [-Wunused-local-typedefs]
typedef internal::Internals I;
^
In file included from ../deps/v8/src/v8globals.h:32:0,
from ../deps/v8/src/v8.h:53,
from ../deps/v8/src/runtime.cc:31:
../deps/v8/src/v8utils.h: In function ‘void v8::internal::CopyWords(T*, const T*, size_t)’:
../deps/v8/src/checks.h:271:22: warning: typedef ‘__StaticAssertTypedef__131’ locally defined but not used [-Wunused-local-typedefs]
SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
^
../deps/v8/src/checks.h:261:39: note: in definition of macro ‘SEMI_STATIC_JOIN_HELPER’
#define SEMI_STATIC_JOIN_HELPER(a, b) a##b
^
../deps/v8/src/checks.h:271:5: note: in expansion of macro ‘SEMI_STATIC_JOIN’
SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
^
../deps/v8/src/checks.h:319:30: note: in expansion of macro ‘STATIC_CHECK’
#define STATIC_ASSERT(test) STATIC_CHECK(test)
This seems to be a bug but I have g++4.8.1 gcc-4.8.1 which are the latest versions that I know of. Please let me know how I can fix this. Thanks.
There is an easier way than bringing old g++, as mentioned in V8 bug report discussion:
http://code.google.com/p/v8/issues/detail?id=2149
You could set additional flag for g++ before using make:
export CXX="g++ -Wno-unused-local-typedefs"
I've had problems with g++ 4.8 compiling v8 (which Node uses), and a bunch of other stuff, so I use 4.7. First install g++-4.7 using apt-get (which I trust you know how to do), and then:
CXX=g++-4.7 make [... etc...]
Related
I am trying to cross compile Boost, but I ended up with the following errors.
I have done the following steps:
Unzipped boost_1_68_0.tar.bz2
Executed Bootstrap
Edited user-config.jam using
gcc:arm:arm-fslc-linux-gnueabi-g++
Executed ./b2 --prefix=install toolset=gcc-arm --user-config=./user-config.jam
also exceuted ./bjam --prefix=install toolset=gcc-arm --user-config=./user-config.jam
But I ended up with the following error:
"arm-fslc-linux-gnueabi-g++" -fPIC -pthread -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/wave/build/gcc-arm/release/threading-multi/cpplexer/re2clex/aq.o" "libs/wave/src/cpplexer/re2clex/aq.cpp"
...failed gcc.compile.c++ bin.v2/libs/wave/build/gcc-arm/release/threading-multi/cpplexer/re2clex/aq.o...
gcc.compile.c++ bin.v2/libs/wave/build/gcc-arm/release/threading-multi/cpplexer/re2clex/cpp_re.o
libs/wave/src/cpplexer/re2clex/cpp_re.cpp:20:10: fatal error: ctime: No such file or directory
#include <ctime>
^~~~~~~
compilation terminated.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are a lot of errors like these.
The problem is with the sysroot. We have to pass sysroot also with the compiler:
gcc : arm : arm-fslc-linux-gnueabi-g++ -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/opt/iotgw-sdk-prod/sysroots/armv7at2hf-neon-fslc-linux-gnueabi
Note: The blank spaces should tabs, not spaces.
The project I am attempting compile is not in any way complex, and references nothing but the standard library and one self-contained library (everything compiles fine on another system). As indicated by the title, it can't even link against something in the standard library, due to things in there not having been compiled with -fPIC, supposedly. I didn't build it myself, nor do I want to, and reinstalling things with apt didn't seem to resolve the "recompile with -fPIC" issue.
I will say that I think one possible source of the issue is due to gcc-multilib or something being installed earlier, but I think that was purged. I don't know, maybe something was overwritten or a conflict arose. Might not even be related. Any ideas?
Running Ubuntu 18.04
g++ -I inc -I /usr/include/mono-2.0 -MMD -MF dep/Nonsense.d -std=c++17 -O3 -fno-stack-protector -fno-unroll-loops -fomit-frame-pointer -Wno-ignored-optimization-argument -c -o obj/Nonsense.o src/Nonsense.cpp
g++ -I inc -I /usr/include/mono-2.0 -MMD -MF dep/Socket.d -std=c++17 -O3 -fno-stack-protector -fno-unroll-loops -fomit-frame-pointer -Wno-ignored-optimization-argument -c -o obj/Socket.o src/Socket.cpp
g++ -shared -flto -o libNonsense.so obj/Nonsense.o obj/Socket.o -Llib -lenet
/usr/bin/x86_64-linux-gnu-ld: obj/Socket.o: relocation R_X86_64_PC32 against symbol `_ZTISt13runtime_error##GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
makefile:22: recipe for target 'libNonsense.so' failed
make: *** [libNonsense.so] Error 1
Apparently, it is compulsory to compile with the -fPIC flag in 64bits platform. If you are making a 32-bits project with linkink with 32-bits library; you don't need -fPIC.
Indeed, without -fPIC, the dynamic linker recalculates adresses for global variables and functions (which are not known in advance in the step of compilation). However, in a 64-bits system, it is not possible to use this technique as it is required to guess in advance the size of adress.
PIC (Position Independent Code), a more sophisticated and complicated process is used. https://eli.thegreenplace.net/2011/11/11/position-independent-code-pic-in-shared-libraries-on-x64 for explanations.
As the error message says, you need to recompile with -fPIC. Your current compiler command does not show the -fPIC option:
g++ -I inc -I /usr/include/mono-2.0 -MMD -MF dep/Socket.d -std=c++17 -O3 -fno-stack-protector -fno-unroll-loops -fomit-frame-pointer -Wno-ignored-optimization-argument -c -o obj/Socket.o src/Socket.cpp
Same for -flto by the way—this flag also has to be specified when compiling in order to be effective.
why am I getting "fatal error: asm/early_ioremap.h: No such file or directory" while building simple hello world kernel driver for x86_64 with Linux 4.4.15 libraries using gcc-4.8.5? gcc is searching for asm/early_ioremap.h which is not available in Linux 4.4.15.
any idea how can i fix this?
/opt/gcc-4.8.5-glibc-2.21-p8/x86_64-linux-gnu/bin/x86_64-linux-gnu-gcc -M -MP -MT '/home/obj/src/kernel/hello_world/hello.o' -MT '/home/obj/src/kernel/hello_world/hello.d' -MT 'hello.E' -MT 'hello.S' -I/home/src/kernel/hello_world -I/home/obj/src/kernel/linux-4.4.15/include -I/home/src/inc -I/home/obj/src/kernel/linux-4.4.15/arch/x86/include -D__KERNEL__ -DMODULE -DPACKET_LEAK_TRACING -DSIZEOF_CPU_REGISTER=8 -DNUM_DEV_CF=0 -DNUM_DEV_USB=0 -mtune=nocona -march=nocona -m64 -pipe -std=gnu89 -g -nostdinc -isystem /opt/gcc-4.8.5-glibc-2.21-p8/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/4.8.5/include -O2 -fno-strict-aliasing -fno-common -ffreestanding -Wall -Wstrict-prototypes -Wno-trigraphs -Wmissing-format-attribute -Wdisabled-optimization -Wwrite-strings -Wimplicit-int -Wmissing-braces -Wmissing-noreturn -Wundef -Wmissing-field-initializers -Wmissing-declarations -Wmissing-prototypes -Wno-unused-parameter -Winline -mcmodel=kernel -fno-omit-frame-pointer -fno-stack-protector -mno-red-zone -fno-asynchronous-unwind-tables -imacros generated/autoconf.h hello.c -I/home/obj/src/kernel/linux-4.4.15/include/uapi/ -I/home/obj/src/kernel/linux-4.4.15/arch/x86/include/uapi/
In file included from /home/obj/src/kernel/linux-4.4.15/arch/x86/include/asm/realmode.h:5:0,
from /home/obj/src/kernel/linux-4.4.15/arch/x86/include/asm/acpi.h:33,
from /home/obj/src/kernel/linux-4.4.15/arch/x86/include/asm/fixmap.h:19,
from /home/obj/src/kernel/linux-4.4.15/arch/x86/include/asm/apic.h:12,
from /home/obj/src/kernel/linux-4.4.15/arch/x86/include/asm/smp.h:12,
from /home/obj/src/kernel/linux-4.4.15/arch/x86/include/asm/mmzone_64.h:10,
from /home/obj/src/kernel/linux-4.4.15/arch/x86/include/asm/mmzone.h:4,
from /home/obj/src/kernel/linux-4.4.15/include/linux/mmzone.h:856,
from /home/obj/src/kernel/linux-4.4.15/include/linux/gfp.h:5,
from /home/obj/src/kernel/linux-4.4.15/include/linux/kmod.h:22,
from /home/obj/src/kernel/linux-4.4.15/include/linux/module.h:13,
from hello.c:1:
/home/obj/src/kernel/linux-4.4.15/arch/x86/include/asm/io.h:43:31: fatal error: asm/early_ioremap.h: No such file or directory
#include <asm/early_ioremap.h>
^
compilation terminated.
gcc is searching for asm/early_ioremap.h which is not available in Linux 4.4.15.
any idea how can i fix this?
I think you've answered your own question; either you figure out where the functionality contained in that header file has moved, or with what it has been replaced, or you use a Linux 4.4.15-compatible hello world module, or you use an older kernel.
Personally, I'd go for trying out another example that is supposed to work with recent versions of Linux.
I've faced a very similar error just recently trying to build a module from the kernel to an out-of-tree output by specifying the O= flag.
It seems to be that this is the part causing the failure for me
make \
-j1 \
-C /lib/modules/4.17.9-041709-generic/build \
M=/home/kbingham/sources/linux/drivers/media/usb/uvc \
O=/tmp/build-uvc \
V=1 \
modules
fails,
with the error:
/usr/src/linux-headers-4.17.9-041709-generic/arch/x86/include/asm/io.h:44:10: fatal error: asm/early_ioremap.h: No such file or directory
#include <asm/early_ioremap.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
whilst
make \
-j1 \
-C /lib/modules/4.17.9-041709-generic/build \
M=/home/kbingham/sources/linux/drivers/media/usb/uvc \
V=1 \
modules
suceeds.
I facing some trouble compiling my programming assignment on my local machine. The program is distribute to us with makefiles and compilation commands that are known to work on the school's Scientific Linux servers. My local machine is Mac OS X El Capitan.
When I compile my program running make on my Mac, I get the following error that prevents compilation from proceeding:
myid-MacBook-Pro:mp6 myid$ make
gcc -g -lm -std=c99 -Wall -Werror -c lodepng.c
clang: error: -lm: 'linker' input unused
make: *** [lodepng.o] Error 1
But when I push that very same code as work in progress to the Linux servers and compile there, everything works fine. The linux servers use gcc and not clang:
[netid#linux-a2 mp6]$ make
gcc -g -lm -std=c99 -Wall -Werror -c functions.c
gcc -g -lm -std=c99 -Wall -Werror main.o lodepng.o imageData.o functions.o -o mp6 -lm
gcc -g -lm -std=c99 -Wall -Werror -c test.c
gcc -g -lm -std=c99 -Wall -Werror test.o lodepng.o imageData.o functions.o solution.o -o test -lm
In the makefile, these are the variable definitions:
CC=gcc
CFLAGS=-g -lm -std=c99 -Wall -Werror
and the target definition for loadpng.o
lodepng.o: lodepng.c
$(CC) $(CFLAGS) -c lodepng.c
I would appreciate any help on understanding this error and overcoming it.
Thank you very much.
Also, on this note, I thought I would say that I've noticed a subtle difference between Clang and GCC. It seems to me that even warnings generated by Clang would prevent the compilation to proceed so the warnings behaves like errors. But for GCC, if it generates warnings, it still compiles the object file. Please correct me if I'm mistaken.
Right now you're getting a compilation error on your Mac because you're trying to pass linker commands (i.e. -lm) into a compilation(i.e. -c). Do not give link flags when you compile (-c flag) your source files.
In the other compilation snippet you provided, the unused linker command seems to pass by unnoticed which isn't a good thing.
For your last question, the flag -Werror should force all compilation warnings to become errors -- which is exactly what you are describing.
I cannot compile ORBIT2:
make[3]: Entering directory `/home/software/orbit2/ORBit2-2.14.19/linc2/src'
/bin/bash ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../linc2/include -I../../linc2/include -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -DG_DISABLE_DEPRECATED -D_GNU_SOURCE -g -O2 -Werror-implicit-function-declaration -MT linc.lo -MD -MP -MF .deps/linc.Tpo -c -o linc.lo linc.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../linc2/include -I../../linc2/include -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -DG_DISABLE_DEPRECATED -D_GNU_SOURCE -g -O2 -Werror-implicit-function-declaration -MT linc.lo -MD -MP -MF .deps/linc.Tpo -c linc.c -fPIC -DPIC -o .libs/linc.o
linc.c: In function ‘link_init’:
linc.c:199:2: error: implicit declaration of function ‘g_thread_supported’
linc.c:200:3: error: implicit declaration of function ‘g_thread_init’
linc.c:204:2: warning: ‘g_type_init’ is deprecated (declared at /usr/local/include/glib-2.0/gobject/gtype.h:667)
linc.c:262:3: error: implicit declaration of function ‘g_cond_new’
linc.c:262:18: warning: assignment makes pointer from integer without a cast
linc.c:263:23: warning: assignment makes pointer from integer without a cast
linc.c: In function ‘link_mutex_new’:
linc.c:324:3: error: implicit declaration of function ‘g_mutex_new’
linc.c:324:3: warning: return makes pointer from integer without a cast
linc.c: In function ‘link_exec_set_io_thread’:
linc.c:463:3: error: implicit declaration of function ‘g_thread_create_full’
linc.c:464:4: error: ‘G_THREAD_PRIORITY_NORMAL’ undeclared (first use in this function)
linc.c:464:4: note: each undeclared identifier is reported only once for each function it appears in
linc.c: In function ‘link_mainloop_handle_input’:
linc.c:94:7: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result
The bug has been reported and apparently fixed here, in october 2013:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=707456
But the fix does not appear to have been committed upstream (latest release 2010):
ftp://ftp.gnome.org/pub/gnome/sources/ORBit2/2.14
nor on the git repository (only 3 commits since early 2013):
https://git.gnome.org/browse/ORBit2/
But I cannot find the patch that fixes the issue.
The problem is also set as 'fixed' here:
https://bugs.archlinux.org/task/39138
but again, there is the patch?
I don't understand how those distributions work. It's frustrating that a fix appears to have been found, but I cannot find it.
I don't understand the content of the orbit2-NMU.patch in the debian issue.
Apart from changes to the debian package the only change i can spot is removing "-DG_DISABLE_DEPRECATED" from CPPFLAGS in linc2/src/Makefile.am
Try it!