Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: GCC vs Clang Date: Fri, 12 Aug 2016 11:29:38 -0700 Organization: None to speak of Lines: 36 Message-ID: References: <4p0oqbh4ail533kg8acdg2u1p3n2d47n6f@4ax.com> <7ed4b3db-62d1-4613-ab0a-84c7f921334c@googlegroups.com> <2c83dfac-49cf-4c4b-9782-fe4e3c0be7ff@googlegroups.com> <395b1cf7-3bd2-4464-937c-708b410710dd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="15949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Af7bR0PI/TVDRoIO/dlPz" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:ZLup/erUBZ+pyBHUfJmyj4Gmc3Q= sha1:UF2Pxk0OTlYnmi1GgrvMNbSXY2g= Xref: csiph.com comp.lang.c:92203 supercat@casperkitty.com writes: > On Friday, August 12, 2016 at 10:33:24 AM UTC-5, Keith Thompson wrote: >> That's possible on Linux too (well, at least for 32 and 64 bits). >> On my system, gcc has "-m32", "-mx32", and "-m64" options. 16-bit int >> is not supported as far as I know. > > Does it use macros to rename standard-library functions like "sscanf" > to indicate whether they expect "%d" to overwrite 4 or 8 bytes, does > it bundle standard-library functions into executables, or does it have > some other way of handling such issues? It uses separate shared libraries. $ ldd hello-m* hello-m32: linux-gate.so.1 => (0xf779e000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf75be000) /lib/ld-linux.so.2 (0xf77a1000) hello-m64: linux-vdso.so.1 => (0x00007ffea198d000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0b2c8ad000) /lib64/ld-linux-x86-64.so.2 (0x00007f0b2cca2000) hello-mx32: linux-vdso.so.1 => (0xfff9a000) libc.so.6 => /libx32/libc.so.6 (0xf7406000) /libx32/ld-linux-x32.so.2 (0xf77d0000) $ Most of the header files are the same (I think the compiler predefines some macros that some of the gcc-specific headers test). -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"