Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22145

How to correctly compile uClibc++ with musl?

$
0
0

I need to compile c++ code with uClibc++ and musl. To do that, first I must compile uClibc++ agains musl. But trying to do so, I have run to a few errors, like missing __snprintf_chk and __cxa_thread_atexit_impl

In short: how are you suppose to do it correctly? I'm prettry sure this has to do with g++ flags, but which?

This is what I have tried so far (for mips):

  1. I compiled musl for mips
  2. Passed musl-gcc to CROSS_COMPILE parameter of uClibc++ make. I also create musl-g++in that same path (which is basicly exactly like musl-gcc with the same .spec file, but uses mips-linux-gnu-g++ and not gcc) My .spec file is the musl auto-generated one, I didn't tuch it.
  3. This is my compilation command:

        make install CROSS_COMPILE=/path/to/my/musl/mips   CPU_CFLAGS=' -lsupc++ -lgcc -nostdlib -nostdinc -nostdinc++ -mmusl -I/path/to/musl/include -Os -fno-use-cxa-atexit -fno-use-stack-protector -D_FORTIFY_SOURC=0 -L/path/to/my/musl/lib -lc
    

Output:

In function '__cxa_thread_atexit':
Undefiend reference to __cxa_thread_atexit_impl
In function 'd_append_chk':
Undefiend reference to __sprintf_chk

Viewing all articles
Browse latest Browse all 22145

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>