mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Build failure on 64 bit machine for 32 bit target
@ 2024-08-06 16:00 Ritvik Tanksalkar
  2024-08-06 19:34 ` Markus Wichmann
  0 siblings, 1 reply; 2+ messages in thread
From: Ritvik Tanksalkar @ 2024-08-06 16:00 UTC (permalink / raw)
  To: musl

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

Hi,

I am not subscribed so I would like to get CC'd for the reply. I've been
trying to get musl build for 32 bit targets on a 64 bit linux machine. For
this, I'm doing the following on musl-1.2.5 -

CC=gcc CFLAGS="-m32" LDFLAGS="-m32" ./configure --host=i686-linux-gnu

and then running "make" results in multiple definition errors while
linking. The following output has been redacted for the sake of brevity.

/usr/bin/ld: obj/compat/time32/__xstat.lo: in function `__fxstat':
__xstat.c:(.text.__fxstat+0x0): multiple definition of `__fxstat';
obj/src/stat/__xstat.lo:__xstat.c:(.text.__fxstat+0x0): first defined here
/usr/bin/ld: obj/compat/time32/__xstat.lo: in function `__fxstatat':
__xstat.c:(.text.__fxstatat+0x0): multiple definition of `__fxstatat';
obj/src/stat/__xstat.lo:__xstat.c:(.text.__fxstatat+0x0): first defined here
/usr/bin/ld: obj/compat/time32/__xstat.lo: in function `__lxstat':
__xstat.c:(.text.__lxstat+0x0): multiple definition of `__lxstat';
obj/src/stat/__xstat.lo:__xstat.c:(.text.__lxstat+0x0): first defined here
/usr/bin/ld: obj/compat/time32/__xstat.lo: in function `__xstat':
__xstat.c:(.text.__xstat+0x0): multiple definition of `__xstat';
obj/src/stat/__xstat.lo:__xstat.c:(.text.__xstat+0x0): first defined here

I'm certain that I'm missing out on something trivial here. Any insights
into this would be appreciated.

Warm Regards,
Ritvik

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

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

* Re: [musl] Build failure on 64 bit machine for 32 bit target
  2024-08-06 16:00 [musl] Build failure on 64 bit machine for 32 bit target Ritvik Tanksalkar
@ 2024-08-06 19:34 ` Markus Wichmann
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Wichmann @ 2024-08-06 19:34 UTC (permalink / raw)
  To: musl; +Cc: Ritvik Tanksalkar

Am Tue, Aug 06, 2024 at 12:00:36PM -0400 schrieb Ritvik Tanksalkar:
> CC=gcc CFLAGS="-m32" LDFLAGS="-m32" ./configure --host=i686-linux-gnu
>

That doesn't work. Try

CC="gcc -m32" ./configure --target=i686 AR=ar RANLIB=ranlib

Your way does not add "-m32" for configure tests. Unfortunately, this
way I am still only able to generate the static library, because the
shared one uses the wrong libgcc. Because -m32 does not change the
output of "gcc -print-libgcc-file-name". No clue how you are supposed to
do this, short of using a real cross compiler.

Ciao,
Markus

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

end of thread, other threads:[~2024-08-06 19:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-06 16:00 [musl] Build failure on 64 bit machine for 32 bit target Ritvik Tanksalkar
2024-08-06 19:34 ` Markus Wichmann

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