How do I solve make: None: Command not found issue? - c++

I am having trouble understanding this error.
make: None: Command not found
make: *** [Makefile:3879: api/api_commands.o] Error 127
I have tried looking but I can't find an answer to the specific issue make: None:.
The full issue and error message is here for clarification.
Help on this would be highly appreciated.
Update
The make file consists of the following (line 3879 separated from the rest for clarification):
...
includes_65 = -I../src/tactic/portfolio -I../src/tactic/smtlogics -I../src/ackermannization -I../src/model -I../src/ast/rewriter -I../src/ast -I../src/util -I../src/math/polynomial -I../src/math/automata -I../src/solver -I../src/tactic -I../src/ast/proofs -I../src/sat/sat_solver -I../src/tactic/core -I../src/ast/macros -I../src/ast/normal_forms -I../src/tactic/aig -I../src/tactic/bv -I../src/ast/rewriter/bit_blaster -I../src/tactic/arith -I../src/sat -I../src/sat/tactic -I../src/nlsat/tactic -I../src/nlsat -I../src/smt/tactic -I../src/smt -I../src/cmd_context -I../src/interp -I../src/smt/proto_model -I../src/smt/params -I../src/ast/pattern -I../src/parsers/smt2 -I../src/parsers/util -I../src/ast/substitution -I../src/math/grobner -I../src/math/euclid -I../src/math/simplex -I../src/ast/fpa -I../src/util/lp -I../src/muz/fp -I../src/muz/base -I../src/qe -I../src/muz/pdr -I../src/muz/transforms -I../src/math/hilbert -I../src/muz/dataflow -I../src/muz/clp -I../src/muz/tab -I../src/muz/rel -I../src/muz/bmc -I../src/muz/duality -I../src/duality -I../src/muz/ddnf -I../src/muz/spacer -I../src/tactic/nlsat_smt -I../src/tactic/ufbv -I../src/tactic/fpa -I../src/tactic/sls -I../src/math/subpaving/tactic -I../src/math/subpaving -I../src/math/interval -I../src/math/realclosure -I../src/opt -I../src
api/z3_macros.h.node: ../src/api/z3_macros.h
#echo done > api/z3_macros.h.node
api/z3_api.h.node: ../src/api/z3_api.h
#echo done > api/z3_api.h.node
...
api/api_ast_vector$(OBJ_EXT): ../src/api/api_ast_vector.cpp api/z3.h.node api/api_log_macros.h.node api/api_context.h.node api/api_ast_vector.h.node ast/ast_translation.h.node ast/ast_smt2_pp.h.node
#echo src/api/api_ast_vector.cpp
#$(CXX) $(CXXFLAGS) $(includes_65) $(CXX_OUT_FLAG)api/api_ast_vector$(OBJ_EXT) ../src/api/api_ast_vector.cpp
api/api_bv$(OBJ_EXT): ../src/api/api_bv.cpp api/z3.h.node api/api_log_macros.h.node api/api_context.h.node api/api_util.h.node ast/bv_decl_plugin.h.node
#echo src/api/api_bv.cpp
#$(CXX) $(CXXFLAGS) $(includes_65) $(CXX_OUT_FLAG)api/api_bv$(OBJ_EXT) ../src/api/api_bv.cpp
api/z3_replayer.h.node: ../src/api/z3_replayer.h api/z3.h.node util/z3_exception.h.node
#echo done > api/z3_replayer.h.node
api/api_commands$(OBJ_EXT): ../src/api/api_commands.cpp api/z3.h.node api/z3_replayer.h.node
#echo src/api/api_commands.cpp
#$(CXX) $(CXXFLAGS) $(includes_65) $(CXX_OUT_FLAG)api/api_commands$(OBJ_EXT) ../src/api/api_commands.cpp
api/api_config_params$(OBJ_EXT): ../src/api/api_config_params.cpp api/z3.h.node
...
Since the previous lines in the make file are of similar format and did not cause any errors, the problem must lie within the api_commands.cpp file. I have looked into this file, but I can't understand what is happening in this code exactly, so I cannot interpret where a None variable is created.
The api_commands.cpp file in question is 4856 lines long, but it consists of several functions of ther format
void exec_Z3_params_set_bool(z3_replayer & in) {
Z3_params_set_bool(
reinterpret_cast<Z3_context>(in.get_obj(0)),
reinterpret_cast<Z3_params>(in.get_obj(1)),
in.get_symbol(2),
in.get_bool(3));
}
and a function void register_z3_replayer_cmds(z3_replayer & in) containing lines such as
in.register_cmd(16, exec_Z3_params_set_bool, "Z3_params_set_bool");
If anyone is familiar with such or similar code and would know how this file is creating a None variable, your help would be highly appreciated.

Related

Linker error: ELF section name out of range

What does this "ELF section name out of range" error mean?
I am trying to build a binary, but constantly getting this linker error.
root#ubuntu:/home/ubuntu/e2c/e2c_core# make all
arm-oe-linux-gnueabi-g++ --sysroot=/home/ubuntu/sysroots/aarch64-oe-linux/ -O0 -g -Wall -fmessage-length=0 -MD -MP -DLINUX=1 -DUSE_CONFIG_FILE=1 --sysroot=/home/ubuntu/sysroots/aarch64-oe-linux/ -fstack-protector -fPIE -z relro -z now -D_FORTIFY_SOURCE=2 -std=c++0x -O3 -Wall -fmessage-length=0 -MD -MP -DLINUX=1 -DUSE_CONFIG_FILE=1 -D__MOCANA_DISABLE_INLINE_ASSEMBLY__ -I. -Iapi/ -Icfg/ -Iplatform/ -Icore/ -Icore/Diagnostics/ -Icore/GreyhoundThread/ -Icore/LIB_Mocana/ -Icore/LIB_ProtonE/ -Icore/Mocana/ -Icore/PKI/ -Icore/Telemetry/ -Icore/UTCtimeSync/ -Icore/jsmn/ -I../e2c_api/ -Ilib/atecclib/ -Ilib/atecclib/lib/ -Ilib/config/ -I../boost/ -I/home/ubuntu/Downloads/libwebsockets/build/include/ -Icore/LIB_Mocana/src/ocsp/ -Iunity/ -include core/E2C_global_include.h -o e2c_core main.o api/api_diy.o api/api_rci.o api/api_sta.o api/TelemetryInterface.o cfg/CloudVariantSetup.o cfg/SwVersion.o core/e2c_core_config.o core/E2C_internal_main.o core/Diagnostics/LegacyDBdiag.o core/GreyhoundThread/FirmwareDownload.o core/GreyhoundThread/GreyhoundThread.o core/GreyhoundThread/Provisioning.o core/GreyhoundThread/UTCtimeSync.o core/GreyhoundThread/WS_Provisioning.o core/jsmn/jsmn.o core/LIB_Mocana/src/asn1/ASN1TreeWalker.o core/LIB_Mocana/src/asn1/derencoder.o core/LIB_Mocana/src/asn1/oiddefs.o core/LIB_Mocana/src/asn1/oidutils.o core/LIB_Mocana/src/asn1/parseasn1.o core/LIB_Mocana/src/asn1/parsecert.o core/LIB_Mocana/src/common/absstream.o core/LIB_Mocana/src/common/altivec.o core/LIB_Mocana/src/common/circ_buf.o core/LIB_Mocana/src/common/circq.o core/LIB_Mocana/src/common/datetime.o core/LIB_Mocana/src/common/debug_console.o core/LIB_Mocana/src/common/dynarray.o core/LIB_Mocana/src/common/hash_table.o core/LIB_Mocana/src/common/hash_value.o core/LIB_Mocana/src/common/int128.o core/LIB_Mocana/src/common/int64.o core/LIB_Mocana/src/common/jacobi.o core/LIB_Mocana/src/common/lucas.o core/LIB_Mocana/src/common/math_arm.o core/LIB_Mocana/src/common/mbitmap.o core/LIB_Mocana/src/common/memfile.o core/LIB_Mocana/src/common/memory_debug.o core/LIB_Mocana/src/common/mem_part.o core/LIB_Mocana/src/common/mem_pool.o core/LIB_Mocana/src/common/merrors.o core/LIB_Mocana/src/common/mocana.o core/LIB_Mocana/src/common/moc_net.o core/LIB_Mocana/src/common/moc_stream.o core/LIB_Mocana/src/common/mprintf.o core/LIB_Mocana/src/common/mrtos.o core/LIB_Mocana/src/common/mstdlib.o core/LIB_Mocana/src/common/mtcp.o core/LIB_Mocana/src/common/prime.o core/LIB_Mocana/src/common/random.o core/LIB_Mocana/src/common/redblack.o core/LIB_Mocana/src/common/rng_seed.o core/LIB_Mocana/src/common/sizedbuffer.o core/LIB_Mocana/src/common/timer.o core/LIB_Mocana/src/common/tree.o core/LIB_Mocana/src/common/uri.o core/LIB_Mocana/src/common/utils.o core/LIB_Mocana/src/common/vlong.o core/LIB_Mocana/src/crypto/aesalgo.o core/LIB_Mocana/src/crypto/aesalgoNi.o core/LIB_Mocana/src/crypto/aes_ccm.o core/LIB_Mocana/src/crypto/aes_cmac.o core/LIB_Mocana/src/crypto/aes.o core/LIB_Mocana/src/crypto/aes_ctr.o core/LIB_Mocana/src/crypto/aes_eax.o core/LIB_Mocana/src/crypto/aes_ecb.o core/LIB_Mocana/src/crypto/aes_keywrap.o core/LIB_Mocana/src/crypto/aes_xcbc_mac_96.o core/LIB_Mocana/src/crypto/aes_xts.o core/LIB_Mocana/src/crypto/ansix9_63_kdf.o core/LIB_Mocana/src/crypto/arc2.o core/LIB_Mocana/src/crypto/arc4.o core/LIB_Mocana/src/crypto/asn1cert.o core/LIB_Mocana/src/crypto/base64m.o core/LIB_Mocana/src/crypto/blowfish.o core/LIB_Mocana/src/crypto/ca_mgmt.o core/LIB_Mocana/src/crypto/cert_store.o core/LIB_Mocana/src/crypto/cms_aux.o core/LIB_Mocana/src/crypto/crypto.o core/LIB_Mocana/src/crypto/des.o core/LIB_Mocana/src/crypto/dh.o core/LIB_Mocana/src/crypto/dsa2.o core/LIB_Mocana/src/crypto/dsa.o core/LIB_Mocana/src/crypto/fips.o core/LIB_Mocana/src/crypto/gcm.o core/LIB_Mocana/src/crypto/hmac.o core/LIB_Mocana/src/crypto/key_utils.o core/LIB_Mocana/src/crypto/md2.o core/LIB_Mocana/src/crypto/md45.o core/LIB_Mocana/src/crypto/md4.o core/LIB_Mocana/src/crypto/md5.o core/LIB_Mocana/src/crypto/nil.o core/LIB_Mocana/src/crypto/nist_rng.o core/LIB_Mocana/src/crypto/pem_key.o core/LIB_Mocana/src/crypto/pkcs10.o core/LIB_Mocana/src/crypto/pkcs12.o core/LIB_Mocana/src/crypto/pkcs1.o core/LIB_Mocana/src/crypto/pkcs5.o core/LIB_Mocana/src/crypto/pkcs7.o core/LIB_Mocana/src/crypto/pkcs8.o core/LIB_Mocana/src/crypto/pkcs_common.o core/LIB_Mocana/src/crypto/pkcs.o core/LIB_Mocana/src/crypto/pkcs_key.o core/LIB_Mocana/src/crypto/primeec_atecc.o core/LIB_Mocana/src/crypto/primeec.o core/LIB_Mocana/src/crypto/primefld.o core/LIB_Mocana/src/crypto/pubcrypto.o core/LIB_Mocana/src/crypto/rc2algo.o core/LIB_Mocana/src/crypto/rc4algo.o core/LIB_Mocana/src/crypto/rsa.o core/LIB_Mocana/src/crypto/sec_key.o core/LIB_Mocana/src/crypto/sha1.o core/LIB_Mocana/src/crypto/sha256.o core/LIB_Mocana/src/crypto/sha512.o core/LIB_Mocana/src/crypto/three_des.o core/LIB_Mocana/src/ocsp/client/ocsp_client.o core/LIB_Mocana/src/ocsp/ocsp_context.o core/LIB_Mocana/src/ocsp/ocsp.o core/LIB_Mocana/src/ocsp/ocsp_http.o core/LIB_Mocana/src/ocsp/ocsp_message.o core/LIB_Mocana/src/platform/linux_rtos.o core/LIB_Mocana/src/platform/linux_tcp_async.o core/LIB_Mocana/src/platform/linux_tcp.o core/LIB_Mocana/src/platform/linux_udp.o core/LIB_Mocana/src/ssl/ssl.o core/LIB_Mocana/src/ssl/ssl_ocsp.o core/LIB_Mocana/src/ssl/sslsock.o core/LIB_ProtonE/src/buffer.o core/LIB_ProtonE/src/error.o core/LIB_ProtonE/src/log.o core/LIB_ProtonE/src/parser.o core/LIB_ProtonE/src/pn_platform.o core/LIB_ProtonE/src/scanner.o core/LIB_ProtonE/src/selectable.o core/LIB_ProtonE/src/types.o core/LIB_ProtonE/src/url.o core/LIB_ProtonE/src/util.o core/LIB_ProtonE/src/codec/codec.o core/LIB_ProtonE/src/codec/decoder.o core/LIB_ProtonE/src/codec/encoder.o core/LIB_ProtonE/src/dispatcher/dispatcher.o core/LIB_ProtonE/src/engine/engine.o core/LIB_ProtonE/src/events/event.o core/LIB_ProtonE/src/framing/framing.o core/LIB_ProtonE/src/message/message.o core/LIB_ProtonE/src/messenger/messenger.o core/LIB_ProtonE/src/messenger/store.o core/LIB_ProtonE/src/messenger/subscription.o core/LIB_ProtonE/src/messenger/transform.o core/LIB_ProtonE/src/object/iterator.o core/LIB_ProtonE/src/object/list.o core/LIB_ProtonE/src/object/map.o core/LIB_ProtonE/src/object/object.o core/LIB_ProtonE/src/object/record.o core/LIB_ProtonE/src/object/string.o core/LIB_ProtonE/src/posix/io.o core/LIB_ProtonE/src/posix/selector.o core/LIB_ProtonE/src/sasl/none_sasl.o core/LIB_ProtonE/src/sasl/sasl.o core/LIB_ProtonE/src/ssl/mocanassl_proton.o core/LIB_ProtonE/src/transport/autodetect.o core/LIB_ProtonE/src/transport/transport.o core/Mocana/MocSetup.o core/Mocana/MocTest.o core/Mocana/TLS_http_get.o core/PKI/CertificateStore.o core/PKI/ILVT.o core/PKI/MDKcode.o core/Telemetry/AMQPlayer.o core/Telemetry/GatewayTerminatedMessages.o core/Telemetry/GHbase64.o core/Telemetry/GHsequence.o core/Telemetry/MsgRouting.o core/Telemetry/RegistrationFlag.o core/Telemetry/TelemetryThread.o core/Telemetry/WSlayer.o core/Telemetry/WS_Stats.o core/Telemetry/PELIB/PELIBassert.o core/Telemetry/PELIB/PELIBmemoryMgmt.o core/Telemetry/PELIB/PELIBplatform.o core/UTCtimeSync/UTCtime.o core/UTCtimeSync/UTCtimeSyncJSON.o platform/Daemon.o platform/Linux_api.o platform/Logger.o platform/Platform.o platform/STA_DNScache.o platform/e2c/BL-RO-Store.o platform/e2c/ConfigStore.o platform/e2c/DebugPrint.o platform/e2c/DeviceConfig.o platform/e2c/E2C_FILE.o platform/e2c/MemoryManager.o platform/e2c/PlatformFileSystem.o lib/config/grammar.o lib/config/libconfig.o lib/config/scanctx.o lib/config/scanner.o lib/config/strbuf.o lib/config/libconfigcpp.o lib/atecclib/libatecc508.a -L../e2c_api/ -L/home/ubuntu/Downloads/libwebsockets/build/lib/ -Wl,--whole-archive -lpthread -ldl -Wl,--no-whole-archive -le2c_api -lrt -lwebsockets -luuid -lcurl
/home/ubuntu/sysroots/x86_64-oesdk-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.3/real-ld: fatal error: /home/ubuntu/sysroots/aarch64-oe-linux/usr/lib/libstdc++.so: ELF section name out of range
What does this actually mean?
In my case I was getting ld : error : myfile: file too short, or sometimes:
ld: warning: myfile has a section extending past end of file
ld : error : myfile: ELF section name out of range
because I was patching for Nix a folder containing both source code and binary blob… and since the number of files to patch was high I used a script to patch them all at the same time (using find and sed -i). Unfortunately, sed was also applied on binary files, which completely corrupted them.
I realized that by printing objdump -a myfile before and after the patching (I would get an error in the second case).

How to pass input parameters to make? [duplicate]

How to pass argument to Makefile from command line?
I understand I can do
$ make action VAR="value"
$ value
with Makefile
VAR = "default"
action:
#echo $(VAR)
How do I get the following behavior?
$ make action value
value
How about
$make action value1 value2
value1 value2
You probably shouldn't do this; you're breaking the basic pattern of how Make works. But here it is:
action:
#echo action $(filter-out $#,$(MAKECMDGOALS))
%: # thanks to chakrit
#: # thanks to William Pursell
EDIT:
To explain the first command,
$(MAKECMDGOALS) is the list of "targets" spelled out on the command line, e.g. "action value1 value2".
$# is an automatic variable for the name of the target of the rule, in this case "action".
filter-out is a function that removes some elements from a list. So $(filter-out bar, foo bar baz) returns foo baz (it can be more subtle, but we don't need subtlety here).
Put these together and $(filter-out $#,$(MAKECMDGOALS)) returns the list of targets specified on the command line other than "action", which might be "value1 value2".
Here is a generic working solution based on #Beta's
I'm using GNU Make 4.1 with SHELL=/bin/bash atop my Makefile, so YMMV!
This allows us to accept extra arguments (by doing nothing when we get a job that doesn't match, rather than throwing an error).
%:
#:
And this is a macro which gets the args for us:
args = `arg="$(filter-out $#,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
Here is a job which might call this one:
test:
#echo $(call args,defaultstring)
The result would be:
$ make test
defaultstring
$ make test hi
hi
Note! You might be better off using a "Taskfile", which is a bash pattern that works similarly to make, only without the nuances of Maketools. See https://github.com/adriancooney/Taskfile
Much easier aproach. Consider a task:
provision:
ansible-playbook -vvvv \
-i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory \
--private-key=.vagrant/machines/default/virtualbox/private_key \
--start-at-task="$(AT)" \
-u vagrant playbook.yml
Now when I want to call it I just run something like:
AT="build assets" make provision
or just:
make provision in this case AT is an empty string
Few years later, want to suggest just for this: https://github.com/casey/just
action v1 v2=default:
#echo 'take action on {{v1}} and {{v2}}...'
You will be better of defining variables and calling your make instead of using parameters:
Makefile
action: ## My action helper
#echo $$VAR_NAME
Terminal
> VAR_NAME="Hello World" make action
Hello World
don't try to do this
$ make action value1 value2
instead create script:
#! /bin/sh
# rebuild if necessary
make
# do action with arguments
action "$#"
and do this:
$ ./buildthenaction.sh value1 value2
for more explanation why do this and caveats of makefile hackery read my answer to another very similar but seemingly not duplicate question: Passing arguments to "make run"

Qt cross compilation from x86 Ubuntu to ARM Beagle Bone almost finished with strange mistake R_ARM_THM_MOVW_ABS_NC

I already spent lots of time on trying to crosscompile Qt 5.2.1 (as a recommended and stable one) from my x86 Ubuntu to ARM Beagle Bone Black. After about 20 minutes the compilation ends with a strange mistake. This is the end of the compilation console output:
rm -f libQt5Core.so.5.2.1 libQt5Core.so libQt5Core.so.5 libQt5Core.so.5.2
/home/piotrek/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ --sysroot=/media/rootfs -Wl,--no-undefined -Wl,-O1 -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,/home/piotrek/qt-everywhere-opensource-src-5.2.1/qtbase/src/corelib/QtCore.dynlist -Wl,-soname,libQt5Core.so.5 -o libQt5Core.so.5.2.1 .obj/qabstractanimation.o .obj/qvariantanimation.o .obj/qpropertyanimation.o .obj/qanimationgroup.o .obj/qsequentialanimationgroup.o .obj/qparallelanimationgroup.o .obj/qpauseanimation.o .obj/qatomic_unix.o .obj/qglobal.o .obj/qglobalstatic.o .obj/qlibraryinfo.o .obj/qmalloc.o .obj/qnumeric.o .obj/qlogging.o .obj/qatomic.o .obj/qexception.o .obj/qresultstore.o .obj/qfutureinterface.o .obj/qfuturewatcher.o .obj/qmutex.o .obj/qreadwritelock.o .obj/qrunnable.o .obj/qmutexpool.o .obj/qsemaphore.o .obj/qthread.o .obj/qthreadpool.o .obj/qthreadstorage.o .obj/qthread_unix.o .obj/qwaitcondition_unix.o .obj/qarraydata.o .obj/qbitarray.o .obj/qbytearray.o .obj/qbytearraymatcher.o .obj/qcollator.o .obj/qcommandlineoption.o .obj/qcommandlineparser.o .obj/qcryptographichash.o .obj/qdatetime.o .obj/qdatetimeparser.o .obj/qeasingcurve.o .obj/qelapsedtimer.o .obj/qfreelist.o .obj/qhash.o .obj/qline.o .obj/qlinkedlist.o .obj/qlist.o .obj/qlocale.o .obj/qlocale_tools.o .obj/qpoint.o .obj/qmap.o .obj/qmargins.o .obj/qmessageauthenticationcode.o .obj/qcontiguouscache.o .obj/qrect.o .obj/qregexp.o .obj/qregularexpression.o .obj/qrefcount.o .obj/qshareddata.o .obj/qsharedpointer.o .obj/qsimd.o .obj/qsize.o .obj/qstring.o .obj/qstringbuilder.o .obj/qstringlist.o .obj/qtextboundaryfinder.o .obj/qtimeline.o .obj/qtimezone.o .obj/qtimezoneprivate.o .obj/qunicodetools.o .obj/qvector.o .obj/qvsnprintf.o .obj/qelapsedtimer_unix.o .obj/qlocale_unix.o .obj/qtimezoneprivate_tz.o .obj/adler32.o .obj/compress.o .obj/crc32.o .obj/deflate.o .obj/gzclose.o .obj/gzlib.o .obj/gzread.o .obj/gzwrite.o .obj/infback.o .obj/inffast.o .obj/inflate.o .obj/inftrees.o .obj/trees.o .obj/uncompr.o .obj/zutil.o .obj/qlocale_icu.o .obj/qcollator_icu.o .obj/qtimezoneprivate_icu.o .obj/pcre16_byte_order.o .obj/pcre16_chartables.o .obj/pcre16_compile.o .obj/pcre16_config.o .obj/pcre16_dfa_exec.o .obj/pcre16_exec.o .obj/pcre16_fullinfo.o .obj/pcre16_get.o .obj/pcre16_globals.o .obj/pcre16_jit_compile.o .obj/pcre16_maketables.o .obj/pcre16_newline.o .obj/pcre16_ord2utf16.o .obj/pcre16_refcount.o .obj/pcre16_string_utils.o .obj/pcre16_study.o .obj/pcre16_tables.o .obj/pcre16_ucd.o .obj/pcre16_utf16_utils.o .obj/pcre16_valid_utf16.o .obj/pcre16_version.o .obj/pcre16_xclass.o .obj/harfbuzz-buffer.o .obj/harfbuzz-gdef.o .obj/harfbuzz-gsub.o .obj/harfbuzz-gpos.o .obj/harfbuzz-impl.o .obj/harfbuzz-open.o .obj/harfbuzz-stream.o .obj/harfbuzz-shaper-all.o .obj/qharfbuzz.o .obj/qabstractfileengine.o .obj/qbuffer.o .obj/qdatastream.o .obj/qdataurl.o .obj/qtldurl.o .obj/qdebug.o .obj/qdir.o .obj/qdiriterator.o .obj/qfile.o .obj/qfiledevice.o .obj/qfileinfo.o .obj/qipaddress.o .obj/qiodevice.o .obj/qlockfile.o .obj/qnoncontiguousbytedevice.o .obj/qprocess.o .obj/qtextstream.o .obj/qtemporarydir.o .obj/qtemporaryfile.o .obj/qresource.o .obj/qresource_iterator.o .obj/qsavefile.o .obj/qstandardpaths.o .obj/qurl.o .obj/qurlidna.o .obj/qurlquery.o .obj/qurlrecode.o .obj/qsettings.o .obj/qfsfileengine.o .obj/qfsfileengine_iterator.o .obj/qfilesystemwatcher.o .obj/qfilesystemwatcher_polling.o .obj/qfilesystementry.o .obj/qfilesystemengine.o .obj/qfileselector.o .obj/qloggingcategory.o .obj/qloggingregistry.o .obj/qfsfileengine_unix.o .obj/qfilesystemengine_unix.o .obj/qlockfile_unix.o .obj/qprocess_unix.o .obj/qfilesystemiterator_unix.o .obj/qstandardpaths_unix.o .obj/qfilesystemwatcher_inotify.o .obj/qabstractitemmodel.o .obj/qabstractproxymodel.o .obj/qitemselectionmodel.o .obj/qidentityproxymodel.o .obj/qsortfilterproxymodel.o .obj/qstringlistmodel.o .obj/qjson.o .obj/qjsondocument.o .obj/qjsonobject.o .obj/qjsonarray.o .obj/qjsonvalue.o .obj/qjsonwriter.o .obj/qjsonparser.o .obj/qpluginloader.o .obj/qfactoryloader.o .obj/quuid.o .obj/qlibrary.o .obj/qelfparser_p.o .obj/qmachparser.o .obj/qlibrary_unix.o .obj/qabstracteventdispatcher.o .obj/qabstractnativeeventfilter.o .obj/qbasictimer.o .obj/qeventloop.o .obj/qcoreapplication.o .obj/qcoreevent.o .obj/qmetaobject.o .obj/qmetatype.o .obj/qmetaobjectbuilder.o .obj/qmimedata.o .obj/qobject.o .obj/qobjectcleanuphandler.o .obj/qsignalmapper.o .obj/qsocketnotifier.o .obj/qtimer.o .obj/qtranslator.o .obj/qvariant.o .obj/qcoreglobaldata.o .obj/qsharedmemory.o .obj/qsystemsemaphore.o .obj/qpointer.o .obj/qmath.o .obj/qsystemerror.o .obj/qcore_unix.o .obj/qcrashhandler.o .obj/qeventdispatcher_unix.o .obj/qtimerinfo_unix.o .obj/qeventdispatcher_glib.o .obj/qsharedmemory_unix.o .obj/qsystemsemaphore_unix.o .obj/qisciicodec.o .obj/qlatincodec.o .obj/qtextcodec.o .obj/qtsciicodec.o .obj/qutfcodec.o .obj/qicucodec.o .obj/qstatemachine.o .obj/qabstractstate.o .obj/qstate.o .obj/qfinalstate.o .obj/qhistorystate.o .obj/qabstracttransition.o .obj/qsignaltransition.o .obj/qeventtransition.o .obj/qmimedatabase.o .obj/qmimetype.o .obj/qmimemagicrulematcher.o .obj/qmimetypeparser.o .obj/qmimemagicrule.o .obj/qmimeglobpattern.o .obj/qmimeprovider.o .obj/qxmlstream.o .obj/qxmlutils.o .obj/qrc_mimetypes.o .obj/moc_qabstractanimation_p.o .obj/moc_qnamespace.o .obj/moc_qthread.o .obj/moc_qthreadpool.o .obj/moc_qfuturewatcher.o .obj/moc_qeasingcurve.o .obj/moc_qlocale.o .obj/moc_qtimeline.o .obj/moc_qfile.o .obj/moc_qfiledevice.o .obj/moc_qiodevice.o .obj/moc_qnoncontiguousbytedevice_p.o .obj/moc_qtextstream_p.o .obj/moc_qtemporaryfile.o .obj/moc_qsavefile.o .obj/moc_qsettings.o .obj/moc_qfilesystemwatcher_p.o .obj/moc_qfilesystemwatcher_polling_p.o .obj/moc_qfilesystemwatcher_inotify_p.o .obj/moc_qabstractitemmodel.o .obj/moc_qstringlistmodel.o .obj/moc_qpluginloader.o .obj/moc_qlibrary.o .obj/moc_qfactoryloader_p.o .obj/moc_qabstracteventdispatcher.o .obj/moc_qeventloop.o .obj/moc_qcoreapplication.o .obj/moc_qcoreevent.o .obj/moc_qmimedata.o .obj/moc_qsocketnotifier.o .obj/moc_qtimer.o .obj/moc_qtranslator.o .obj/moc_qobjectcleanuphandler.o .obj/moc_qsharedmemory.o .obj/moc_qeventdispatcher_unix_p.o .obj/moc_qeventdispatcher_glib_p.o .obj/moc_qabstractstate.o .obj/moc_qstate.o .obj/moc_qfinalstate.o .obj/moc_qhistorystate.o .obj/moc_qabstracttransition.o .obj/moc_qsignaltransition.o .obj/moc_qeventtransition.o -lrt -ldl -lpthread -licui18n -licuuc -lm -ldl -pthread -L/media/rootfs/usr/lib/arm-linux-gnueabihf -lgthread-2.0 -lglib-2.0 -lrt
/home/piotrek/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: /media/rootfs/usr/lib/arm-linux-gnueabihf/libglib-2.0.a(libglib_2_0_la-gmain.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/media/rootfs/usr/lib/arm-linux-gnueabihf/libglib-2.0.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [../../lib/libQt5Core.so.5.2.1] Error 1
make[3]: Leaving directory `/home/piotrek/qt-everywhere-opensource-src-5.2.1/qtbase/src/corelib'
make[2]: *** [sub-corelib-make_first] Error 2
make[2]: Leaving directory `/home/piotrek/qt-everywhere-opensource-src-5.2.1/qtbase/src'
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory `/home/piotrek/qt-everywhere-opensource-src-5.2.1/qtbase'
make: *** [module-qtbase-make_first] Error 2
I start the compilation process with standard command:
sudo make -j4
I believe the important part of the error output is:
(libglib_2_0_la-gmain.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
My Qt was configured with following command:
(device linux-beagleboard-g++ was edited for the Beaglebone)
sudo ./configure -prefix /home/piotrek/qt-everywhere-opensource-src-5.4.0 -device linux-beagleboard-g++ -device-option CROSS_COMPILE=/home/piotrek/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- -sysroot /media/rootfs -release -opensource -confirm-license -opengl es2 -v -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb -qt-xkbcommon
How can i eliminate this error and push the compilation foreward? Where does it come form?
This is not related to your problem, I am asking anyways. Why do you to use Qt5.2.1. It quite old and lacking many improvements of newer versions.

Inconsistent ifeq and ifneq

I can't figure out why in the following the two different versions yield different results:
$(INCLUDE_DIR)/%: TRGT_PATH = \
$(INCLUDE_DIR)/$(patsubst $(word 1,$(subst /, ,$(dir $*)))/%,%,$*)
$(INCLUDE_DIR)/%: INCLUDEDS = $(TRGT_PATH)
$(INCLUDED_FILES) : $(INCLUDE_DIR)/%: %
ifeq ($(TRGT_PATH),$(findstring $(TRGT_PATH),$(INCLUDEDS)))
#echo [INC][WARN] File $(TRGT_PATH) already exists while copying from $*
else
#echo $(findstring $(TRGT_PATH),$(INCLUDEDS))
#echo [INC] $* $(TRGT_PATH)
#cp $* $(TRGT_PATH)
endif
Output:
[INC][WARN] File include/GeometricObject.h already exists while copying from engine/GeometricObject.h
[INC][WARN] File include/util.h already exists while copying from engine/util.h
[INC][WARN] File include/util.h already exists while copying from test/util.h
If I change the line ifeq ($(TRGT_PATH),$(findstring $(TRGT_PATH),$(INCLUDEDS))) to ifneq (,$(findstring $(TRGT_PATH),$(INCLUDEDS))) the output is:
include/GeometricObject.h
[INC] engine/GeometricObject.h include/GeometricObject.h
include/util.h
[INC] engine/util.h include/util.h
include/util.h
[INC] test/util.h include/util.h
As far as I know $(findstring t,l) returns the t if t is in l and else an empty string. But the output (if VAR is equals LIST) still is:
foo
bar
Can someone explain?
PS: I tested a more simple code and that worked fine...
If you'd provided a complete example, including the values of VAR and LIST, we'd be able to help. As it is, all I can say is "it works for me", so you must not be accurately reporting your environment in your question:
$ cat Makefile
VAR = v
LIST = v
all:
ifneq (,$(findstring $(VAR),$(LIST)))
#echo foo
else
#echo bar
endif
$ make
foo
ETA:
Aha. Well, your problem has absolutely nothing to do with findstring, so it's not surprising that your original question was not answerable.
The issue is that you're trying to use target-specific variables in a non-recipe context, and the documentation clearly states that they are not available outside of recipes.
The ifeq, etc. statements are like preprocessor statements: they are evaluated as the makefile is being parsed, not later when the recipes are being invoked. So the values of TRGT_PATH and INCLUDEDS when the ifeq/ifneq is invoked are the global values of those variables (which might be the empty string if they're not set otherwise) not the target-specific values.

Eclipse - Error in re-setting breakpoint in C++ Project

I'm using Eclipse Juno with the CDT Plugin, but I've tried in Indigo as well and this problem happens there too. I'm on Ubuntu 12.04.
I've created a new C++ project with the following code. I've set a breakpoint on the second line.
#include <iostream>
using namespace std;
int main() {
cout << "Hello world" << endl;
cout << "Hi there" << endl; // I've set a breakpoint here using eclipse
}
And my Makefile is this
CXX := g++
CXXFLAGS := -g -c
LDFLAGS := -g -std=c++11
OBJ_FILES := main.o
.PHONY: all clean
all: $(OBJ_FILES)
$(CXX) $(LDFLAGS) $(OBJ_FILES) -o proj2
main.o: main.cpp
$(CXX) $(CXXFLAGS) main.cpp -o main.o
clean:
rm -rf *.o proj2
When I run this in Debug mode in eclipse, everything builds fine, but when it runs, gdb spits out this message:
Error in re-setting breakpoint 1: Function "/home/gulshan/Code/EECS281Workspace/Project 2/main.cpp:7" not defined.
It might be worth noting that in this case I've unchecked the option eclipse gives you to break at startup, but when that option is check, it is able to break at the first line without any problem.
What's going on? Here is the GDB trace in case that helps.
707,811 2-environment-cd "/home/gulshan/Code/EECS281Workspace/Project 2"
707,811 2^done
707,812 (gdb)
707,812 3-gdb-set breakpoint pending on
707,813 3^done
707,813 (gdb)
707,814 4-gdb-set detach-on-fork on
707,814 4^done
707,814 (gdb)
707,815 5-enable-pretty-printing
707,815 5^done
707,815 (gdb)
707,815 6-gdb-set python print-stack none
707,816 6^done
707,816 (gdb)
707,816 7-gdb-set print object on
707,817 7^done
707,817 (gdb)
707,818 8-gdb-set print sevenbit-strings on
707,818 8^done
707,818 (gdb)
707,818 9-gdb-set host-charset UTF-8
707,818 9^done
707,819 (gdb)
707,819 10-gdb-set target-charset UTF-8
707,819 10^done
707,819 (gdb)
707,820 11-gdb-set target-wide-charset UTF-32
707,820 11^done
707,820 (gdb)
707,820 12source .gdbinit
707,821 &"source .gdbinit\n"
707,821 &".gdbinit: No such file or directory.\n"
707,821 12^error,msg=".gdbinit: No such file or directory."
707,821 (gdb)
707,822 13-gdb-set target-async off
707,822 13^done
707,822 (gdb)
707,823 14-gdb-set auto-solib-add on
707,823 14^done
707,824 (gdb)
707,827 15-file-exec-and-symbols --thread-group i1 "/home/gulshan/Code/EECS281Workspace/Project 2/pr\
oj2"
707,828 15^done
707,828 (gdb)
707,834 16-break-insert --thread-group i1 -f "\"/home/gulshan/Code/EECS281Workspace/Project 2/main.c\
pp\":7"
707,836 16^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004007d4"\
,func="main()",file="main.cpp",fullname="/home/gulshan/Code/EECS281Workspace/Project 2/main.cpp",lin\
e="7",times="0",original-location="/home/gulshan/Code/EECS281Workspace/Project 2/main.cpp:7"}
707,837 (gdb)
707,843 17-inferior-tty-set --thread-group i1 /dev/pts/2
707,844 17^done
707,844 (gdb)
707,847 18-exec-run --thread-group i1
707,848 =thread-group-started,id="i1",pid="22982"
707,848 =thread-created,id="1",group-id="i1"
707,848 18^running
707,848 *running,thread-id="all"
707,848 (gdb)
707,849 19-list-thread-groups --available
707,851 =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",h\
ost-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
707,870 &"Error in re-setting breakpoint 1: Function \"/home/gulshan/Code/EECS281Workspace/Project 2\
/main.cpp:7\" not defined.\n"
707,872 =breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="n",addr="<PENDI\
NG>",pending="/home/gulshan/Code/EECS281Workspace/Project 2/main.cpp:7",times="0",original-location=\
"/home/gulshan/Code/EECS281Workspace/Project 2/main.cpp:7"}
707,873 =library-loaded,id="/usr/lib/x86_64-linux-gnu/libstdc++.so.6",target-name="/usr/lib/x86_64-l\
inux-gnu/libstdc++.so.6",host-name="/usr/lib/x86_64-linux-gnu/libstdc++.so.6",symbols-loaded="0",thr\
ead-group="i1"
707,874 =library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc\
.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1"
707,874 =library-loaded,id="/lib/x86_64-linux-gnu/libm.so.6",target-name="/lib/x86_64-linux-gnu/libm\
.so.6",host-name="/lib/x86_64-linux-gnu/libm.so.6",symbols-loaded="0",thread-group="i1"
707,874 =library-loaded,id="/lib/x86_64-linux-gnu/libgcc_s.so.1",target-name="/lib/x86_64-linux-gnu/\
libgcc_s.so.1",host-name="/lib/x86_64-linux-gnu/libgcc_s.so.1",symbols-loaded="0",thread-group="i1"
708,269 =thread-exited,id="1",group-id="i1"
708,270 =thread-group-exited,id="i1",exit-code="0"
708,270 *stopped,reason="exited-normally"
708,270 (gdb)
708,278 20-gdb-exit
708,278 21-data-evaluate-expression $_exitcode
708,291 19^error,msg="Quit"
708,291 (gdb)
708,292 20^exit
708,292 22-break-delete --thread-group i1 1
Looks like there's a bug in GDB 7.4 that has a problem with setting breakpoints using paths with spaces: http://sourceware.org/bugzilla/show_bug.cgi?id=13798
I've removed all of the spaces in the path containing the file and it works now.
It may happen also if you have modified the code during a debug session. Just Run/"Remove all breakpoints" solves the problem.