* C++ questions
@ 2015-06-05 21:34 John Mudd
2015-06-05 21:56 ` Szabolcs Nagy
0 siblings, 1 reply; 5+ messages in thread
From: John Mudd @ 2015-06-05 21:34 UTC (permalink / raw)
To: musl; +Cc: John Mudd
[-- Attachment #1: Type: text/plain, Size: 881 bytes --]
I've been building an app with musl and it worked well for years. Recently
one of the proprietary libs that I use has been updated to include C++ code
along with the usual C code.
In the past (in a non-musl environment) I've gotten this to work by
loading libstdc++.so. I tried that again but I get the following error when
trying to load libstdc++.so.
Error loading shared library ld-linux.so.2: No such file or directory
(needed by /usr/lib/i386-linux-gnu/libstdc++.so.6)
I looked at the notes about C++ in the musl faqs. For that I decided it
might help if I built gcc in musl. Then everything will be musl-ized? I
built gmp, mpfr and mpc. Started building gcc but got the following error.
/home/mudd/musl/gcc-4.9.2.obj/gcc/../../gcc-4.9.2/gcc/plugin.c:579:
undefined reference to `dlopen'
Before I go further, any opinions if I'm even headed in the right direction?
John
[-- Attachment #2: Type: text/html, Size: 1087 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: C++ questions
2015-06-05 21:34 C++ questions John Mudd
@ 2015-06-05 21:56 ` Szabolcs Nagy
2015-06-05 22:57 ` John Mudd
2015-06-09 20:17 ` John Mudd
0 siblings, 2 replies; 5+ messages in thread
From: Szabolcs Nagy @ 2015-06-05 21:56 UTC (permalink / raw)
To: musl; +Cc: John Mudd
* John Mudd <johnbmudd@gmail.com> [2015-06-05 17:34:52 -0400]:
> Error loading shared library ld-linux.so.2: No such file or directory
> (needed by /usr/lib/i386-linux-gnu/libstdc++.so.6)
>
create an empty ld-linux.so.2
gcc -o ld-linux.so.2 -xc -shared - </dev/null
(nowadays toolchains sometimes add the dynamic linker to
elf DT_NEEDED, i dont know why, it's not really needed)
> I looked at the notes about C++ in the musl faqs. For that I decided it
> might help if I built gcc in musl. Then everything will be musl-ized? I
> built gmp, mpfr and mpc. Started building gcc but got the following error.
>
> /home/mudd/musl/gcc-4.9.2.obj/gcc/../../gcc-4.9.2/gcc/plugin.c:579:
> undefined reference to `dlopen'
>
you have to patch gcc and use certain options to make it work
musl-cross build scripts take care of if
(there are prebuilt toolchains too)
> Before I go further, any opinions if I'm even headed in the right direction?
>
you may get away without building
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: C++ questions
2015-06-05 21:56 ` Szabolcs Nagy
@ 2015-06-05 22:57 ` John Mudd
2015-06-09 20:17 ` John Mudd
1 sibling, 0 replies; 5+ messages in thread
From: John Mudd @ 2015-06-05 22:57 UTC (permalink / raw)
To: musl; +Cc: John Mudd
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
Thanks. I recognize the "create empty lib" advice. Will try asap but
heading to airport now.
On Jun 5, 2015 5:56 PM, "Szabolcs Nagy" <nsz@port70.net> wrote:
> * John Mudd <johnbmudd@gmail.com> [2015-06-05 17:34:52 -0400]:
> > Error loading shared library ld-linux.so.2: No such file or directory
> > (needed by /usr/lib/i386-linux-gnu/libstdc++.so.6)
> >
>
> create an empty ld-linux.so.2
>
> gcc -o ld-linux.so.2 -xc -shared - </dev/null
>
> (nowadays toolchains sometimes add the dynamic linker to
> elf DT_NEEDED, i dont know why, it's not really needed)
>
> > I looked at the notes about C++ in the musl faqs. For that I decided it
> > might help if I built gcc in musl. Then everything will be musl-ized? I
> > built gmp, mpfr and mpc. Started building gcc but got the following
> error.
> >
> > /home/mudd/musl/gcc-4.9.2.obj/gcc/../../gcc-4.9.2/gcc/plugin.c:579:
> > undefined reference to `dlopen'
> >
>
> you have to patch gcc and use certain options to make it work
>
> musl-cross build scripts take care of if
> (there are prebuilt toolchains too)
>
> > Before I go further, any opinions if I'm even headed in the right
> direction?
> >
>
> you may get away without building
>
[-- Attachment #2: Type: text/html, Size: 1627 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: C++ questions
2015-06-05 21:56 ` Szabolcs Nagy
2015-06-05 22:57 ` John Mudd
@ 2015-06-09 20:17 ` John Mudd
2015-06-09 20:25 ` Rich Felker
1 sibling, 1 reply; 5+ messages in thread
From: John Mudd @ 2015-06-09 20:17 UTC (permalink / raw)
To: musl, John Mudd
[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]
On Fri, Jun 5, 2015 at 5:56 PM, Szabolcs Nagy <nsz@port70.net> wrote:
> * John Mudd <johnbmudd@gmail.com> [2015-06-05 17:34:52 -0400]:
> > Error loading shared library ld-linux.so.2: No such file or directory
> > (needed by /usr/lib/i386-linux-gnu/libstdc++.so.6)
> >
>
> create an empty ld-linux.so.2
>
> gcc -o ld-linux.so.2 -xc -shared - </dev/null
>
> (nowadays toolchains sometimes add the dynamic linker to
> elf DT_NEEDED, i dont know why, it's not really needed)
>
> > I looked at the notes about C++ in the musl faqs. For that I decided it
> > might help if I built gcc in musl. Then everything will be musl-ized? I
> > built gmp, mpfr and mpc. Started building gcc but got the following
> error.
> >
> > /home/mudd/musl/gcc-4.9.2.obj/gcc/../../gcc-4.9.2/gcc/plugin.c:579:
> > undefined reference to `dlopen'
> >
>
> you have to patch gcc and use certain options to make it work
>
> musl-cross build scripts take care of if
> (there are prebuilt toolchains too)
>
> > Before I go further, any opinions if I'm even headed in the right
> direction?
> >
>
> you may get away without building
>
Thanks again. Adding the empty ld-linux.so.2 helped. I also had to
add libgcc_s.so.1 and the following _chk stubs.
http://pastebin.com/TeieBKCE
John
[-- Attachment #2: Type: text/html, Size: 2099 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: C++ questions
2015-06-09 20:17 ` John Mudd
@ 2015-06-09 20:25 ` Rich Felker
0 siblings, 0 replies; 5+ messages in thread
From: Rich Felker @ 2015-06-09 20:25 UTC (permalink / raw)
To: musl
On Tue, Jun 09, 2015 at 04:17:11PM -0400, John Mudd wrote:
> On Fri, Jun 5, 2015 at 5:56 PM, Szabolcs Nagy <nsz@port70.net> wrote:
>
> > * John Mudd <johnbmudd@gmail.com> [2015-06-05 17:34:52 -0400]:
> > > Error loading shared library ld-linux.so.2: No such file or directory
> > > (needed by /usr/lib/i386-linux-gnu/libstdc++.so.6)
> > >
> >
> > create an empty ld-linux.so.2
> >
> > gcc -o ld-linux.so.2 -xc -shared - </dev/null
> >
> > (nowadays toolchains sometimes add the dynamic linker to
> > elf DT_NEEDED, i dont know why, it's not really needed)
> >
> > > I looked at the notes about C++ in the musl faqs. For that I decided it
> > > might help if I built gcc in musl. Then everything will be musl-ized? I
> > > built gmp, mpfr and mpc. Started building gcc but got the following
> > error.
> > >
> > > /home/mudd/musl/gcc-4.9.2.obj/gcc/../../gcc-4.9.2/gcc/plugin.c:579:
> > > undefined reference to `dlopen'
> > >
> >
> > you have to patch gcc and use certain options to make it work
> >
> > musl-cross build scripts take care of if
> > (there are prebuilt toolchains too)
> >
> > > Before I go further, any opinions if I'm even headed in the right
> > direction?
> >
> > you may get away without building
>
> Thanks again. Adding the empty ld-linux.so.2 helped. I also had to
> add libgcc_s.so.1 and the following _chk stubs.
>
> http://pastebin.com/TeieBKCE
New ABI compat coming up soon (hopefully in the next release) will
eliminate the need to add these yourself -- and the ones we add will
actually perform the correct overflow/etc. checks.
Rich
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-06-09 20:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-05 21:34 C++ questions John Mudd
2015-06-05 21:56 ` Szabolcs Nagy
2015-06-05 22:57 ` John Mudd
2015-06-09 20:17 ` John Mudd
2015-06-09 20:25 ` Rich Felker
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).