mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jorge Almeida <jjalmeida@gmail.com>
To: musl@lists.openwall.com
Subject: -m32
Date: Mon, 29 May 2017 19:22:54 +0100	[thread overview]
Message-ID: <CAKpSnp+y4KWoiu0JhhJp4DmRSJCi3jRshdh5+x6z22k6CjOX_Q@mail.gmail.com> (raw)

I tried to compile a "hello world" program (on a x86_64 system) with
the -m32 flag of gcc:


/opt/bin/musl-gcc -static -march=native -Os -m32 -fomit-frame-pointer
-pipe -Wall  -Werror=pedantic  -Werror=implicit-function-declaration
-Wno-unused-function -pedantic -pedantic-errors
-mpreferred-stack-boundary=4 -falign-functions=1 -falign-jumps=1
-falign-loops=1 -fno-unwind-tables -fdata-sections -ffunction-sections
-Wl,--gc-sections -fno-asynchronous-unwind-tables -std=c99 -o foo
.foo.c
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld:
i386 architecture of input file
`/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/32/crtbegin.o' is incompatible
with i386:x86-64 output
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld:
i386 architecture of input file `/tmp/cc9x8D3p.o' is incompatible with
i386:x86-64 output
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld:
i386 architecture of input file
`/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/32/crtend.o' is incompatible
with i386:x86-64 output
collect2: error: ld returned 1 exit status
make: *** [.makefile_foo:15: foo] Error 1


Is there anything missing with my gcc, or is -m32 just not supported?

(I checked that the same program compiles and works correctly with glibc)

thanks

Jorge Almeida


             reply	other threads:[~2017-05-29 18:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 18:22 Jorge Almeida [this message]
2017-05-29 20:08 ` -m32 Laurent Bercot
2017-05-29 21:07   ` -m32 Jorge Almeida
2017-05-29 21:23     ` -m32 Matias Fonzo
2017-05-29 22:41       ` -m32 Jorge Almeida
2017-05-30  0:17         ` -m32 Rich Felker
2017-05-30  8:26           ` -m32 Jorge Almeida

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKpSnp+y4KWoiu0JhhJp4DmRSJCi3jRshdh5+x6z22k6CjOX_Q@mail.gmail.com \
    --to=jjalmeida@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).