Re: gcc -m32 option on amd64.



On Sat, 2007-07-28 at 17:55 +1000, Peter Jeremy wrote:
On 2007-Jul-27 17:32:35 +0100, Tom Evans <tevans.uk@xxxxxxxxxxxxxx> wrote:
gcc on amd64 is capable of generating i386 code, but ld on amd64 is
incapable of linking i386 code together without serious amounts of work.

Can you elaborate on what you mean by "incapable of linking i386 code"?
The stock ld can definitely link i386 code:
turion% ld -V
GNU ld version 2.15 [FreeBSD] 2004-05-23
Supported emulations:
elf_i386_fbsd
elf_x86_64_fbsd
turion%

There is a problem that the 32-bit pathnames on FreeBSD/amd64 are
different to the 32-bit pathnames on FreeBSD/i386 (ie an i386
executable built on amd64 will point to /libexec/ld-elf32.so.1, rather
than /libexec/ld-elf.so.1) so the result won't execute on a
FreeBSD/i386 box - but I don't see that as a problem with ld, rather
the configuration.


Sure. By 'incapable of linking i386 code' I mean that the default
toolchain of gcc invoking ld to assemble libraries and object files into
executables is incapable of doing so when compiling i386 code. I say
without serious amounts of work because, as you point out, it is
possible to do.

Any other english sentences you need explaining?

Attachment: signature.asc
Description: This is a digitally signed message part



Relevant Pages

  • Re: gcc -m32 option on amd64.
    ... incapable of linking i386 code together without serious amounts of work. ... There is a problem that the 32-bit pathnames on FreeBSD/amd64 are ... rather than /libexec/ld-elf.so.1) so the result won't execute on a ...
    (freebsd-hackers)
  • Old chesnut: trying to get statically linked executable
    ... I have an executable created by linking a bunch of C and C++ files ... My problem is that when I execute the executable linked with this ... libstdc++.a, it expects libstdc++ to be in the LIBPATH. ... libraries other than system libraries, need to be loaded at run-time. ...
    (comp.unix.aix)
  • Re: Group Policy to call a batch file
    ... I tried linking the policy to the TEST OU and it did not execute. ... I then tried linking it to the COMPUTER OU and it did not execute on that computer no matter who the user is. ... If you run the script as a logon script, remember that it will be executed in the user's context. ...
    (microsoft.public.windows.group_policy)
  • Re: Problems finding 64-bit library at run-time.
    ... which adds it to ld.so.1's search path at runtime. ... > the GNU GMP library, but whilst I can get programs to execute, the way I ... > Again omitting the sparcv9 will mean the library is not found, ... like a bigger hack to me than linking your programs correctly in the first ...
    (comp.unix.solaris)
  • Re: gcc -m32 option on amd64.
    ... incapable of linking i386 code together without serious amounts of work. ... The stock ld can definitely link i386 code: ... turion% ld -V ... executable built on amd64 will point to /libexec/ld-elf32.so.1, ...
    (freebsd-hackers)