I'm cross-building dart for armel (a client hired me to solve problems there)
I'm building on ubuntu 14.04 (the armel gcc/g++ is 4.7.3).
I want to take out -Werror since I'm seeing:
/usr/bin/arm-linux-gnueabi-g++ '-DDART_NO_SNAPSHOT' '-DDART_PRECOMPILER' '-DTARGET_ARCH_ARM' '-DNDEBUG' '-D_FORTIFY_SOURCE=2' -Iruntime -Werror -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wvla -Woverloaded-virtual -g3 -ggdb3 -fno-rtti -fno-exceptions -fstack-protector -Wa,--noexecstack -marm -mfpu=vfp -Wno-psabi -fno-strict-overflow -O3 -ffunction-sections -fno-omit-frame-pointer -MMD -MF out/ReleaseXARM/.deps/out/ReleaseXARM/obj.target/libdart_vm_nosnapshot/runtime/vm/compiler.o.d.raw -c -o out/ReleaseXARM/obj.target/libdart_vm_nosnapshot/runtime/vm/compiler.o runtime/vm/compiler.cc
In file included from runtime/vm/isolate.h:18:0,
from runtime/vm/growable_array.h:15,
from runtime/vm/compiler.h:9,
from runtime/vm/compiler.cc:5:
runtime/vm/thread.h: In static member function 'static dart::RawError* dart::Compiler::CompileClass(const dart::Class&)':
runtime/vm/thread.h:167:17: error: variable 'thread' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
cc1plus: all warnings being treated as errors
make: *** [out/ReleaseXARM/obj.target/libdart_vm_nosnapshot/runtime/vm/compiler.o] Error 1
BUILD FAILED
I'm working with this dart git tree:
commit 1d028eed8dfa00ac9d4ff685e61b01e6909dbeb4
Author: Paul Berry <paulberry#google.com>
Date: Wed Nov 30 12:28:51 2016 -0800
This is an actual bug in the code. One way to fix it would be to mark the thread variable volatile.
Related
I am trying to install johnson, in order to install harmony with Centos 8.
gem install johnson
I keep getting the error that there is no such file as node.h. But I have clearly installed nodejs, and nodejs-devel (I used the latest packages from stream: nodejs:18)
I am using Discourse community software, so require a specific version or ruby
current directory: /usr/local/share/gems/gems/johnson-1.2.0/ext/spidermonkey
make "DESTDIR="
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -I/usr/local/share/gems/gems/johnson-1.2.0/vendor/spidermonkey/Linux_All_DBG.OBJ -I/usr/local/share/gems/gems/johnson-1.2.0/vendor/spidermonkey -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -g -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DXP_UNIX -m64 -o context.o -c context.c
In file included from context.h:4,
from context.c:1:
spidermonkey.h:21: warning: "MAYBE_UNUSED" redefined
# define MAYBE_UNUSED(name) name __attribute__((unused))
In file included from /usr/include/ruby/config.h:18,
from /usr/include/ruby/ruby.h:24,
from /usr/include/ruby.h:33,
from spidermonkey.h:7,
from context.h:4,
from context.c:1:
/usr/include/ruby/config-x86_64.h:152: note: this is the location of the previous definition
#define MAYBE_UNUSED(x) __attribute__ ((__unused__)) x
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -I/usr/local/share/gems/gems/johnson-1.2.0/vendor/spidermonkey/Linux_All_DBG.OBJ -I/usr/local/share/gems/gems/johnson-1.2.0/vendor/spidermonkey -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -g -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DXP_UNIX -m64 -o conversions.o -c conversions.c
In file included from conversions.h:4,
from conversions.c:1:
spidermonkey.h:21: warning: "MAYBE_UNUSED" redefined
# define MAYBE_UNUSED(name) name __attribute__((unused))
In file included from /usr/include/ruby/config.h:18,
from /usr/include/ruby/ruby.h:24,
from /usr/include/ruby.h:33,
from spidermonkey.h:7,
from conversions.h:4,
from conversions.c:1:
/usr/include/ruby/config-x86_64.h:152: note: this is the location of the previous definition
#define MAYBE_UNUSED(x) __attribute__ ((__unused__)) x
In file included from conversions.c:2:
js_land_proxy.h:11:10: fatal error: node.h: No such file or directory
#include "node.h"
^~~~~~~~
compilation terminated.
make: *** [Makefile:245: conversions.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/share/gems/gems/johnson-1.2.0 for inspection.
Results logged to /usr/local/lib64/gems/ruby/johnson-1.2.0/gem_make.out
It is possible to get gcc configure options with gcc -v (an example is here). Is there a similar way to retrieve the compilation options of clang?
My real task is the following one: I have an environment with a compiler (clang) which I want to improve. Now I have some patch for clang that I applied and I want to rebuild the patched sources, but I also want to be sure that nothing changes from the vanilla build apart from my patch; in particular, that all the build flags I use are the same.
No, probably not. But it's possible to get the CXXFLAGS/LDFLAGS clang was compiled with via llvm-config.
$ llvm-config --cxxflags
-I/opt/compiler/llvm-trunk/include -march=native -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
$ llvm-config --ldflags
-L/opt/compiler/llvm-trunk/lib
$ llvm-config --system-libs
-lrt -ldl -lcurses -latomic -lpthread -lz -lm
If you are on a Linux distribution, then simply check the PKGBUILD (or similar) to find the exact flags.
I got a good Automatic Number Plate Recognition Project from github (https://github.com/kornelik/anpr ). In order to run this we need OpenCV and Tesseract Optical Character Recognition library (https://code.google.com/p/tesseract-ocr/). It works fine in my Ubuntu 12.04 , 32bit system.
The problem is that while I setting the same working code in another system (Ubuntu 12.04 , 32 bit) after configuring OpenCV and Tesseract it produces the following error while making the project.I am struggling to find out what is the issue
The error is
g++ -Wall -Werror -O2 -c main.cpp -o main.o
g++ -Wall -Werror -O2 -c recognizer.cpp -o recognizer.o
g++ -Wall -Werror -O2 -c conio.cpp -o conio.o
g++ -Wall -Werror -O2 -c ocr_char.cpp -o ocr_char.o
ocr_char.cpp: In constructor ‘anpr::OCRChar::Impl::Impl(const string&, const string&)’:
ocr_char.cpp:17:9: error: ‘set’ is not a member of ‘std’
ocr_char.cpp:17:18: error: expected primary-expression before ‘char’
ocr_char.cpp:17:18: error: expected ‘;’ before ‘char’
ocr_char.cpp:23:17: error: ‘goodChars’ was not declared in this scope
make: *** [ocr_char.o] Error 1
Is your code updated? On nov 2013 there was a commit to include the set header:
https://github.com/kornelik/anpr/commit/2a63fb362e6fc79ac73f172195a893b37287d3bf
The error message you got seems to be related to that.
Compiled ok on Ubuntu 14.04 64 bits.
I am trying to do a gem install therubyracer-heroku -v '0.8.1.pre3', but I am getting errors while building, it is a big log but here is the last failing lines (pasted full log in the end):
g++ -o obj/release/bootstrapper.o -c -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-rtti -fno-exceptions -fvisibility=hidden -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -DV8_TARGET_ARCH_IA32 -DENABLE_VMSTATE_TRACKING -DENABLE_LOGGING_AND_PROFILING -DENABLE_DEBUGGER_SUPPORT -Isrc src/bootstrapper.cc
src/bootstrapper.cc: In static member function 'static bool v8::internal::Genesis::CompileScriptCached(v8::internal::Vector<const char>, v8::internal::Handle<v8::internal::String>, v8::internal::SourceCodeCache*, v8::Extension*, v8::internal::Handle<v8::internal::Context>, bool)':
src/bootstrapper.cc:1002:18: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
src/bootstrapper.cc: In member function 'bool v8::internal::Genesis::InstallNatives()':
src/bootstrapper.cc:1227:24: error: variable 'name' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
scons: *** [obj/release/bootstrapper.o] Error 1
scons: building terminated because of errors.
make: *** [build/v8/libv8.a] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
I have googled about his for many hours and looked into a lot of SO similar questions, but nothing helped, also I don't know what is mkmf log mean and where to find it.
Additional information:
OS: Ubuntu, 12.04
I already have nodeJs installed, version is v0.8.14 (Just giving this info, since it may be linked with this)
Ruby version: 1.9.3
RVM is used
When I try to compile libc++ (libcxx) on my Ubuntu 12.04 with LLVM 3.0 and Clang 3.0 i get the error
+ clang++ -c -g -Os -fPIC -std=c++0x -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion -Wnewline-eof -Wpadded -Wmissing-prototypes -Wstrict-aliasing=2 -Wstrict-overflow=4 -nostdinc++ -I../include ../src/stdexcept.cpp
../src/stdexcept.cpp:18:10: fatal error: 'cxxabi.h' file not found
#include <cxxabi.h>
^
1 error generated.
Where should I put cxxabi.h? It's currently in the following places
/usr/include/c++/4.4/cxxabi.h
/usr/include/c++/4.6/cxxabi.h
/usr/include/c++/4.7/cxxabi.h
My best guess is that any of these cxxabi.h will work. The only thing std except.cpp is looking for is if it is being used with libc++abi, which will be false for all 3 of your cxxabi.h.