mailing list of musl libc
 help / color / mirror / code / Atom feed
* How to cross-compiling
@ 2015-11-18 10:28 Frieder Berthold
  2015-11-18 11:03 ` Szabolcs Nagy
  0 siblings, 1 reply; 5+ messages in thread
From: Frieder Berthold @ 2015-11-18 10:28 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

Hey to all,

after some hints on this list I tried out the cross-compiling scripts from
Gregor (https://bitbucket.org/GregorR/musl-cross/).
They worked and I got a folder /opt/cross/x86_64-linux-musl .
I symlinked the ld-musl-$ARCH.so to /bin/ldd:

          ll /bin/ldd
          lrwxrwxrwx 1 root root 24 Nov 16 17:04 /bin/ldd ->
/lib/ld-musl-x86_64.so.1


With this cross compiler I configured zlib (which has no other dependencies
than libc) as follows:
CC=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc ./configure

If I use this ldd on my newly build zlib it tells me, that it is itself the
libc.so:
          /bin/ldd libz.so.1
                /bin/ldd (0x7fa6ab41d000)
                libc.so => /bin/ldd (0x7fa6ab41d000)

I assume this is the correct way and therefore tried to build jamVM (
http://jamvm.sourceforge.net/) with musl and my zlib (build with musl).
I copied the zlib into /opt/cross/x86_64-linux-mus/x86_64-linux-musl/lib
and run configure on jamVM:
CC=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc ./autogen.sh
--with-java-runtime-library=openjdk8

It tells me, that it can't find the libz.so.

So my question is: Is this the right way to configure and where does it
look for the libz.so if not in the corresponding lib folder of the
cross-compiler?

Thanks in advance!
Frieder

[-- Attachment #2: Type: text/html, Size: 1755 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to cross-compiling
  2015-11-18 10:28 How to cross-compiling Frieder Berthold
@ 2015-11-18 11:03 ` Szabolcs Nagy
  2015-11-18 11:19   ` Frieder Berthold
  0 siblings, 1 reply; 5+ messages in thread
From: Szabolcs Nagy @ 2015-11-18 11:03 UTC (permalink / raw)
  To: musl

* Frieder Berthold <berthold.frieder@googlemail.com> [2015-11-18 11:28:04 +0100]:
> I copied the zlib into /opt/cross/x86_64-linux-mus/x86_64-linux-musl/lib

i assume you also copied the headers to include/

> and run configure on jamVM:
> CC=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc ./autogen.sh
> --with-java-runtime-library=openjdk8
> 

you may need to pass --target=x86_64-linux-musl somewhere

> It tells me, that it can't find the libz.so.
> 
> So my question is: Is this the right way to configure and where does it
> look for the libz.so if not in the corresponding lib folder of the
> cross-compiler?
> 

autogen.sh can fail for any reason, you should look at
the failing command (e.g. in configure.log), most
likely the failure is completely unrelated to libz.so


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to cross-compiling
  2015-11-18 11:03 ` Szabolcs Nagy
@ 2015-11-18 11:19   ` Frieder Berthold
  2015-11-18 12:39     ` Szabolcs Nagy
  0 siblings, 1 reply; 5+ messages in thread
From: Frieder Berthold @ 2015-11-18 11:19 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]

I copied also the headers.
I know passed --target=x86_64-linux-musl --build=x86_64-linux-musl
--host=x86_64-linux-musl
to configure as well.
In configure it states that it can't find the libz.so, which is the reason
for termination.

There is also a folder lib in /opt/cross/x86_64-linux-musl/ (so one level
higher) do i have to copy the lib in there as well?

2015-11-18 12:03 GMT+01:00 Szabolcs Nagy <nsz@port70.net>:

> * Frieder Berthold <berthold.frieder@googlemail.com> [2015-11-18 11:28:04
> +0100]:
> > I copied the zlib into /opt/cross/x86_64-linux-mus/x86_64-linux-musl/lib
>
> i assume you also copied the headers to include/
>
> > and run configure on jamVM:
> > CC=/opt/cross/x86_64-linux-musl/bin/x86_64-linux-musl-gcc ./autogen.sh
> > --with-java-runtime-library=openjdk8
> >
>
> you may need to pass --target=x86_64-linux-musl somewhere
>
> > It tells me, that it can't find the libz.so.
> >
> > So my question is: Is this the right way to configure and where does it
> > look for the libz.so if not in the corresponding lib folder of the
> > cross-compiler?
> >
>
> autogen.sh can fail for any reason, you should look at
> the failing command (e.g. in configure.log), most
> likely the failure is completely unrelated to libz.so
>

[-- Attachment #2: Type: text/html, Size: 1833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to cross-compiling
  2015-11-18 11:19   ` Frieder Berthold
@ 2015-11-18 12:39     ` Szabolcs Nagy
  2015-11-19 13:08       ` Frieder Berthold
  0 siblings, 1 reply; 5+ messages in thread
From: Szabolcs Nagy @ 2015-11-18 12:39 UTC (permalink / raw)
  To: musl

* Frieder Berthold <berthold.frieder@googlemail.com> [2015-11-18 12:19:26 +0100]:
> In configure it states that it can't find the libz.so, which is the reason
> for termination.
> 

you have to check the failing command, it is really possible
that it has nothing to do with libz.so, so there is no point
speculating about the right path until you know what went
wrong.

there is a configure.log which should show the command that
failed, so you should be able to reproduce the failure
and then see the searched paths etc.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to cross-compiling
  2015-11-18 12:39     ` Szabolcs Nagy
@ 2015-11-19 13:08       ` Frieder Berthold
  0 siblings, 0 replies; 5+ messages in thread
From: Frieder Berthold @ 2015-11-19 13:08 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 768 bytes --]

I found the reason for the failure using strace on configure:
/etc/ld-musl-x86_64.path was missing. I added it with the path to my libs
and then it worked.

2015-11-18 13:39 GMT+01:00 Szabolcs Nagy <nsz@port70.net>:

> * Frieder Berthold <berthold.frieder@googlemail.com> [2015-11-18 12:19:26
> +0100]:
> > In configure it states that it can't find the libz.so, which is the
> reason
> > for termination.
> >
>
> you have to check the failing command, it is really possible
> that it has nothing to do with libz.so, so there is no point
> speculating about the right path until you know what went
> wrong.
>
> there is a configure.log which should show the command that
> failed, so you should be able to reproduce the failure
> and then see the searched paths etc.
>

[-- Attachment #2: Type: text/html, Size: 1204 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-19 13:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 10:28 How to cross-compiling Frieder Berthold
2015-11-18 11:03 ` Szabolcs Nagy
2015-11-18 11:19   ` Frieder Berthold
2015-11-18 12:39     ` Szabolcs Nagy
2015-11-19 13:08       ` Frieder Berthold

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).