ICL, OS X.4/5 and Unix compliance ($UNIX2003) - macos

I'm trying to compile a Mac version of our lib for a customer that wants to include it in a Photoshop plugin, and he is having trouble linking our lib into his app. More detailed info: His plugin is built against the CS4 Photoshop SDK, which means the Mac OS base SDK should be 10.4. My lib is a static one, compiled with the Intel compiler 11.1 and the base SDK is also set as 10.4.
I tested my lib against a small test app I wrote, and it compiles and works fine (on 10.5). To replicate my customer's environment, the app is compiled with gcc, and uses the 10.4 base SDK. While its fine for me, my customer cannot manage to link with my lib. The problem is the following: Undefined symbols:
"_fputs$UNIX2003", referenced from:
_write_message in libMyLib.a(libm_error.o)
When I compile my lib with gcc,and all other project settings the same, its fine, he can generate an executable. As soon as I compile with ICL, it breaks down. Could it be that ICL 11.1 is not compatible with 10.4? On the Fortran compiler forum, I found the following answer:"From the output provided it appears Xcode defaulted to Mac OS X 10.4, which the 11.1 compilers do not support." (http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/68647/)
Does that mean ICL 11.1 does not run on 10.4, or that the code it generates doesn't work on 10.4??
On the following page (http://software.intel.com/en-us/articles/performance-tools-for-software-developers-compatibility-of-intel-compiler-for-mac-os-x-and-xcode/), it also says that ICL 11.1 is not compatible with 10.4 (again same question: what does compatibility mean?). However, it says that ICL 10.1 is, so I tried. But now, even my own test app does not link, for the same reason (undefined function$UNIX2003).
Does anybody know what is the problem, and how to fix it? Or a way to work around it?
Thanks in advance,
A
PS: bonus point if somebody knows what this one means:
ld: absolute addressing (perhaps -mdynamic-no-pic) used in _Cholesky from libMyLib.a(Cholesky.o) not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs

So the answer is: compile with ICL 10.1, not 11.1. None of the Intel libs used by 10.1 contain references to $UNIX2003 routines.
Hope it helps somebody.
A

Ultimately, you're going to need to get Intel product support from Intel, but if you want to sell Mac software that actually works then you should probably just use the same toolchain as everyone else and forget about it.

Related

Universal macOS app won't build due to sqlite3 dylib being arm only

I am building a universal macOS app which uses sqlite3.
The library that comes with the system is of course architecture specific.
So when archiving, XCode ignores the system library and emits linker errors because there is not an intel version.
So will I have to download and embed a multi-architecture version of the library?
Or is there a weak link flag I can use?
Also the compiler emits a warning about sqlite version built for newer OS version (13) than being linked (deployment target macOS 12).
TIA
Mark
Sorry about noise. Discovered I could embed the sqlite3 source directly into my project.
Downloaded amalgamation source file and it just worked (with some minor warnings about int sizes).

How can I use the pre-compiled binaries to update to clang 3.3 on Mac OS 10.6.x?

I'm trying to install/update my clang from Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn) to clang version 3.3. I've downloaded the pre-compiled binaries into usr/bin/, as suggested by other posts (How can I update clang to 3.3 on Mac OS X 10.6).
The point of this installation/update is to be able to use C++ code (not written by me, and written for a newer machine OS 10.8.x) on my mac. I would preferentially use Xcode to update this, but unfortunately, Apple has not made the necessary version of Xcode available for free without a developer's subscription.
I've edited my PATH and LD_LIBRARY_PATH to include clang3.3/bin/ and clang3.3/lib, but I get an "Illegal Instruction" error and it's not clear to me why this is.
What I'd really like is to try the whole process again from the beginning with a step-by-step outline of the process, like is seen here (How to install clang pre-built binaries ubuntu 12.04), except for Mac OSX system, not Ubuntu.
I realize there are some previous threads that ask almost the same question, but I am asking specifically for these versions (and from a standpoint that includes very little experience installing via terminal/understanding pathways/etc.).
Thanks for any help.

Get SDL working with OSX Lion

SDL uses some functions that no longer work using the MacOSX10.7 SDK. I am not very familiar with MacPorts and I would like to know if there is a way to tell macports to build SDL using the 10.6 SDK instead.
If this is not possible, I can download the source and compile it myself, but again, I am not familiar with how to set the flags that I need. I would like a 32-bit build of SDL that uses the 10.6 SDK but runs on Lion.
I have successfully built SDL framework for ppc, i386 and x86_64 using the following diff: http://r.research.att.com/sdl-1.2.14.diff
and the project in SDL-1.2.14/Xcode/SDL/SDL.xcodeproj. The diff uses 10.5 SDK so if you don't have that, you can simply change the 10.5 line to 10.6 and remove ppc.
If you don't want to build it, a binary is available at http://r.research.att.com/libs/SDL-1.2.14-fw-darwin9-bin3.tar.gz - it works on OS X 10.5 and higher (i.e., including Lion).
(I gave up to trying to fix the configure + make build which is broken for OS X since it has a lot of stuff hard-coded that is many years out of date, because I needed it quickly...)

how do I build a universal binary with xcode 3.2.6?

I am using XCode 3.2.6 on an Intel Mac running OS X 10.6, to build a fairly simple app that needs to be able to run under OS 10.4 on a PPC-based Mac, in addition to modern Intel-based Macs.
Under the project settings, I only see options for 32-bit Intel, 64-bit Intel, and Standard (32/64 Intel). Should I be seeing a "Universal Binary" entry here?
I don't have any problem running it under 10.4 on an Intel Mac. I was careful not to use features that don't work under 10.4, and I think I set the project settings correctly to allow it to be backward-compatible to 10.4. It's just that I can't figure out how to get it to compile for PPC.
I'm flailing around, trying to figure out how to build a universal binary, and I think I'm probably just missing something obvious. Any help would be greatly appreciated.
You don't have to choose one of the predefined settings for the Architectures build setting. You can choose "Other..." and then explicitly enter a list of architectures like ppc, i386, x86_64.
By the way, there are extra tricks if you need to run on G3s: You must use GCC 4.0 and the 10.4 SDK.

How do I build Universal binaries (ppc/i386) using Xcode 3.2.2 for OSX?

I am trying to build a universal binary for a project at work, but I can't seem to get Xcode set up properly to do so.
I am familiar with the Apple Documentation regarding this, but apparently I am not reading it correctly.
The Xcode build options in question seem to be:
Architectures
Base SDK
C/C++ Compiler Version
Mac OS X Deployment Target
In my settings I have the following Valid Architectures: i386 ppc ppc64 ppc7400 ppc970 x86_64.
If I use the following options, I get a binary with i386 and ppc970:
Architectures: i386 ppc
Base SDK: Mac OS X 10.5
C/C++ Compiler Version: GCC 4.0
Mac OS X Deployment Target: Mac OS X 10.5
I have several questions about this:
Why ppc970 and not ppc7400 (or simply ppc)?
What is the difference between the ppcs (ppc, ppc64, ppc7400, ppc970)?
How do I get a binary for any ppc?
Apparently, I need a binary with ppc7400 to work on the Mac Mini we have for testing. The Mini has a G4 and is running OSX 10.5.8. From what I can tell, a binary with ppc7400 works but not one with only ppc970.
I have tried several combinations of the above build options, including changing my Base SDK to 10.4u. The above configuration is the only one that even builds. Other builds fail, often because of not recognizing header files or clearly available #defines. For example, if I change my compiler to gcc 4.2, I get errors searching for stdarg.h because of the #include_next directive and no clear path to correct headers. If I drop my Base SDK to 4.0, #define FSIZE long long is no longer recognized despite not changing any includes.
I'd really appreciate any insight you can give me on this.
EDIT UPDATE
Thanks for the info. I understand the flags now. But I get a strange result.
These are my build flags now:
GCC_VERSION = 4.0
MACOSX_DEPLOYMENT_TARGET = 10.4
SDKROOT = macosx10.5
GCC_MODEL_TUNING = G3
This produces object file (.o) that have arch 'ppc' as shown by lipo. All the included libs and frameworks are either 'ppc' or 'ppc7400' (again as shown by lipo). But, the final build is 'ppc970'.
I have gone over this very carefully to ensure I got everything. Can anyone think of a reason for the ppc architecture differences?
I've even gone so far as to create a new project (Hello World) and link it to all the libs and frameworks of the first project. Hello builds as 'ppc' not 'ppc970'.
This just makes no sense to me.
ppc970 == G5. If you need to support as far back as the G4 then just build for ppc7400.
Rather than messing with individual architecture settings, though, you can just select 32-bit Universal (or Standard (32/64-bit Universal), if appropriate) from the popup menu, and that should give you what you need.
In target settings make below changes..
GCC_MODEL_PPC64 = NO
i.e., uncheck “Use 64-bit integer Math”.
Enabling will turn on 64 bit. So it will be G5 onwards..

Resources