On Tue, Dec 15, 2015 at 9:56 AM, IOhannes m zmoelnig zmoelnig@iem.at wrote:
On 2015-12-13 23:16, katja wrote:
iven to both compiler and linker:
-arch i386 -arch x86_64 -mmacosx-version-min=10.5
One thing I noticed when building fat binaries: gcc doesn't define __i386__ or __x86_64__ which we use to conditionally compile bithacks.
?are you sure?
$ cc --version i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) $ cat > testarch.c <<EOL #include <stdio.h> int main() { #ifdef __i386__ printf("i386\n"); #endif #ifdef __x86_64__ printf("x86_64\n"); #endif return 0; } EOL $ make testarch CFLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.5" $ ./testarch x86_64 $ arch -i386 ./testarch i386 $ arch -x86_64 ./testarch x86_64 $
This looks good, thanks for proving me wrong. Which OSX version is this? I've had troubles with denormals in fat binaries in the past (OSX 10.5). It turned out that the preprocessor didn't pass architecture defines when preprocessing for multiple architectures. The behavior has apparently changed with compiler version. I'll look into this matter again.
For this reason I'm now thinking that single-architecture should be the default in a generic build system, and fat binary an option.
dunno. i think that the default should be to just use the system-defaults (don't tell the compiler which architecture it should build for). this is driven by the experience with tehe template/Makefile: there are a number of externals out there that don't build on recent OSX, because the original template-Makefile would build for PowerPC and apple dropped out-of-the-box support for ppc.
otoh. it's obviously of utmost importance that any thus-compiled external loads correctly under a "default" Pd installation.
so for practical reasons it's probably best to use i386/x86_64 (and don't enable PPC by default)
On 'recent' OSX (>= 10.6) Makefile.pdlibbuilder builds i386 / x86_64 by default, no ppc. For OSX 10.5 the default includes ppc which was still supported at that time. OSX 10.5 can build the fattest binaries out of the box. But I didn't include ppc 64 bit (yet) as I've never had an opportunity to test that.
fgmadr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list