Why there is only libgcc.a?
I am currently build my own gcc/g++ tools, and I find there is only libgcc.a, but no libgcc.so.
Why does this happen, and can I dynamicly link libgcc?
See also questions close to this topic
-
docker <.h> no such file or directory
what could be the reason gcc compiler throwing file not found error when compiled in docker container environment?
In docker environment, error threw only one header file among 10 header files. It didn't throw for rest 9 include <.h> statement. I don't understand.
It worked perfectly fine when compiled normally. I am pretty sure that I added all include library files on docker and made reference to it using -I, -L, and -l option in gcc command.
-
Poco build: infinite loop when makedepend.gcc on Ubuntun 20.04 gcc/g++ version: 10.2
I build Poco 1.9.0 with gcc/g++ 7.5.0 of Ubuntu 18.05, there is no any problem. However, the build fail on Ubuntu 20.04 with gcc/g++ 10.2.0 the build process go into infinite loop, it stuck at creating dependency refer the below message until I manually stop it with CTRL+C.
** Creating dependency info for src/LineEndingConverter.cpp mkdir -p /home/thales/LDC/Poco/Foundation/.dep/Linux/x86_64 /home/thales/LDC/Poco/build/script/makedepend.gcc src/LineEndingConverter.cpp ...........
-
GCC [for ARM] force no floating point
I would like to create a build of my embedded C code which specifically checks that floating point operations aren't introduced into it by accident. I've tried adding
+nofp
to my [cortex-m3
] processor architecture but GCC for ARM doesn't like that (probably because the cortex-m3 doesn't have a floating point unit). I've tried specifying-mfpu=none
but that isn't a permitted option. I've tried leaving-lm
off the linker command-line but the linker seems too clever to be fooled by that and is compiling code withdouble
in it and resolvingpow()
anyway.This post: https://gcc.gnu.org/legacy-ml/gcc-help/2011-07/msg00093.html from 2011 hints that GCC has no such option, since no-one is interested in it, which surprises me as it seems like a common thing to want, at least from an embedded standpoint, to avoid accidental C-library bloat.
Does anyone know of a way to do this with GCC/newlib without me having to go through and manually hack stuff out of the C library file it chooses?
-
determine whether wchar_t is a built-in type or alias
Yes,
wchar_t
is supposed to be a built-in type in C++; unfortunately, that's not the case with some (very) old compilers. 😟Is there a (compiler-specific, e.g., GCC/g++) way to determine whether
wchar_t
is a built-in type (keyword) or atypedef
? The reason is to determine whetherf(wchar_t)
can be an overload; ifwchar_t
is atypedef
, it will (very likely) be the same asf(uint16_t)
orf(uint32_t)
.Microsoft Visual C++ has
_NATIVE_WCHAR_T_DEFINED
so I can write:#include <stdint.h> #if defined(_MSC_VER) #define MY_PROJECT_wchar_t_is_built_in_ (_NATIVE_WCHAR_T_DEFINED == 1) #else #define MY_PROJECT_wchar_t_is_built_in_ 1 #endif void f(uint16_t ch_utf16) { /* UTF-16 processing */ } void f(uint32_t ch_utf32) { /* UTF-32 processing */ } #if MY_PROJECT_wchar_t_is_built_in_ #include <type_traits> void f(whcar_t ch_) { using wchar_t_type = std::conditional<sizeof(wchar_t) == sizeof(uint32_t), uint32_t, uint16_t>::type; #ifdef _WIN32 static_assert(sizeof(wchar_t_type) == sizeof(uint16_t), "wchar_t should be 16-bits on Windows."); #endif const auto ch = reinterpret_cast<wchar_t_type>(ch_); f(ch); } #endif
Extensive TMP probably won't work (e.g.,
std::enable_if
) ... as it's an old compiler causing the problem in the first place! -
What does GCC internally do on passing -fprofile-arcs -ftest-coverage, so that linker reports "common of `symbol' overridden by definition"
I am trying to obtain coverage report of a library, say libaccesscontrol.so while unit testing it. The library libaccesscontrol.so has dependency on other libraries, say libsettings.so, libfilemanager.so, liblogging.so. While building the test executable I am passing:
CXXFLAGS=--coverage ... -Wl,--warn-common, ...
The compilation goes fine. However during linking I get:
/usr/lib/gcc/x86_64-linux-gnu/7/libgcov.a(_gcov.o): warning: common of `__gcov_var' overridden by definition _b-amd64-none-dlld/bin/liblogging.so: warning: defined here
I am looking for a way to obtain coverage, while having the --warn-common option in place. So, I would like to understand why are there multiple appearances of the global symbol __gcov_var?
When I look at the dynamic symbol table of above libraries, I see:
nm -CD liblogging.so | grep __gcov .. 00000000002119d8 B __gcov_error_file 0000000000211680 D __gcov_master 000000000000b130 T __gcov_sort_n_vals 0000000000211a20 B __gcov_var
It's evident that there are __gcov symbols in the dynamic libraries, but how is the dependecy for those symbols created?
I suppose if libgcov.a were a dynamic library, I wouldn't be getting those warnings and as it is a static library the symbols are appearing in the dynamic libraries of my project. Please correct me if I am wrong here.
Any recommended readings are most welcome.
Thanks for your time.
-
Is there a way to change the path to a shared library for a generated .so file without regenerating it
I need to modify one of the share library paths used by my *.so file. Due to a limitation I don't have the option to regenerate the .so file.
Also I am familiar with changing the rpath in .so and thats not what i am after. The library path in discussion is a absolute path and the rpath has no effect on it.
Thanks!
-
libgcc_s.so.1 must be installed for pthread_cancel to work Aborted (core dumped)
I am new to the apache server. I have written a python script(script.py) to train my ML model and placed it in /var/www/Project_Name/ path.
When I am trying to run this through python3 script.py command, it throws an error:
libgcc_s.so.1 must be installed for pthread_cancel to work Aborted (core dumped)
However, while checking I found libgcc is already installed in my system with the below configuration:
libgccpp.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgccpp.so.1 libgcc_s.so.1 (libc6,x32) => /usr/libx32/libgcc_s.so.1 libgcc_s.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgcc_s.so.1 libgcc_s.so.1 (libc6) => /usr/lib32/libgcc_s.so.1
Can anyone help me with what I can do about this?
Will provide every possible information.
EDIT: I tried running a dummy script that just prints a message. It is running!!
-
Compile not optimized Libgcc for ARM
Good morning,
I need to compile libgcc from scratch without deploying the ARM optimized version which is defined in ieee754-sf.s in the ARM back-end. Does anyone knows how to configure GCC for excluding ieee754-sf.s ( in libgcc/config/arm ) to compile from scratch libgcc, in particular compiling vanilla floating-point soft-fp emulation which is in libgcc/spft-fp ?
Thanks