You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build static C++ code using openwrt toolchain with gcc compiler 7.3.0 for x64 arch.
It works fine without "-static" , links against "libgcc_s.so.1"
But with "-static" compiler does not link against libgcc_pic.a.
/lib/../lib64/libstdc++.a(eh_alloc.o): In function __gnu_cxx::__scoped_lock::~__scoped_lock()': eh_alloc.cc:(.text._ZN9__gnu_cxx13__scoped_lockD2Ev[_ZN9__gnu_cxx13__scoped_lockD5Ev]+0x4b): undefined reference to _Unwind_Resume'
/tmp/ccedkPfo.o: In function Test()': unwind.cpp:(.text+0x4d): undefined reference to _Unwind_Resume'
/tmp/ccedkPfo.o: In function main': unwind.cpp:(.text+0x6f): undefined reference to _Unwind_Resume'
/lib/../lib64/libstdc++.a(eh_personality.o): In function base_of_encoded_value(unsigned char, _Unwind_Context*) [clone .part.3]': eh_personality.cc:(.text._ZL21base_of_encoded_valuehP15_Unwind_Context.part.3+0x26): undefined reference to _Unwind_GetDataRelBase'
eh_personality.cc:(.text._ZL21base_of_encoded_valuehP15_Unwind_Context.part.3+0x2c): undefined reference to _Unwind_GetTextRelBase' eh_personality.cc:(.text._ZL21base_of_encoded_valuehP15_Unwind_Context.part.3+0x32): undefined reference to _Unwind_GetRegionStart'
If I include "-lgcc_pic" it compiles OK
I think compiler should autoinclude gcc_pic as it does in dynamic build
The text was updated successfully, but these errors were encountered:
bolvan:
I'm trying to build static C++ code using openwrt toolchain with gcc compiler 7.3.0 for x64 arch.
It works fine without "-static" , links against "libgcc_s.so.1"
But with "-static" compiler does not link against libgcc_pic.a.
#include <stdio.h>
class CTest
{
public:
CTest()
{
printf("Test\n");
}
~CTest()
{
printf("unTest\n");
}
};
void Test()
{
CTest c;
throw (int)1;
}
int main()
{
try
{
Test();
}
catch(int Test)
{
}
return 0;
}
/lib/../lib64/libstdc++.a(eh_alloc.o): In function
__gnu_cxx::__scoped_lock::~__scoped_lock()': eh_alloc.cc:(.text._ZN9__gnu_cxx13__scoped_lockD2Ev[_ZN9__gnu_cxx13__scoped_lockD5Ev]+0x4b): undefined reference to
_Unwind_Resume'/tmp/ccedkPfo.o: In function
Test()': unwind.cpp:(.text+0x4d): undefined reference to
_Unwind_Resume'/tmp/ccedkPfo.o: In function
main': unwind.cpp:(.text+0x6f): undefined reference to
_Unwind_Resume'/lib/../lib64/libstdc++.a(eh_personality.o): In function
base_of_encoded_value(unsigned char, _Unwind_Context*) [clone .part.3]': eh_personality.cc:(.text._ZL21base_of_encoded_valuehP15_Unwind_Context.part.3+0x26): undefined reference to
_Unwind_GetDataRelBase'eh_personality.cc:(.text._ZL21base_of_encoded_valuehP15_Unwind_Context.part.3+0x2c): undefined reference to
_Unwind_GetTextRelBase' eh_personality.cc:(.text._ZL21base_of_encoded_valuehP15_Unwind_Context.part.3+0x32): undefined reference to
_Unwind_GetRegionStart'If I include "-lgcc_pic" it compiles OK
I think compiler should autoinclude gcc_pic as it does in dynamic build
The text was updated successfully, but these errors were encountered: