Shipping a compiler with applications?
Shipping a compiler with applications?
- Subject: Shipping a compiler with applications?
- From: Andrew Miller <email@hidden>
- Date: Wed, 11 Oct 2006 17:06:12 +1300
Hi,
My application generates C source code, compiles and links it to a
shared object, and then loads it into the core. On non-OSX platforms,
this is supported by compiling gcc and GNU binutils, and shipping the
minimum set of stripped binaries needed for the compiler to work in my
packages. However, GNU binutils doesn't seem to support OSX properly, so
I assume I need to use cctool from Apple.
A few questions:
1) Is it true that all OSX boxes come with gcc / ld on them? Can I just
assume that it will be there, or is it likely to be missing on
non-developer systems? Is there a list of what files are on a pristine
install of OSX for each version anywhere?
2) How can I build an ld for maximum forwards and backwards
compatibility? I have tried to build cctools-622.3, but it doesn't work
just by running make (I get the following error):
Building on: Darwin <hostname> 8.7.0 Darwin Kernel Version 8.7.0: Fri
May 26 15:20:53 PDT 2006; root:xnu-792.6.76.obj~1/RELEASE_PPC Power
Macintosh powerpc
with Xcode 2.4
cc -O -g -I../../include -Wall -Wno-long-double -no-cpp-precomp
-fno-builtin-round
-D_MACH_I386_THREAD_STATUS_FPSTATE_LEGACY_FIELD_NAMES_
-D_ARCHITECTURE_I386_FPU_FPSTATE_LEGACY_FIELD_NAMES_ -static -DRLD
-DSA_RLD -fno-builtin -finline -fno-keep-inline-functions
-fsigned-bitfields -force_cpusubtype_ALL -msoft-float -nostdinc
-I/System/Library/Frameworks/Kernel.framework/PrivateHeaders/libsa
-I/System/Library/Frameworks/Kernel.framework/PrivateHeaders
-I/System/Library/Frameworks/Kernel.framework/Headers/libsa
-I/System/Library/Frameworks/Kernel.framework/Headers/bsd
-I/System/Library/Frameworks/Kernel.framework/Headers -DKERNEL
-DKERNEL_PRIVATE -DAPPLE -DNeXT -DLIBSA_PRIVATE -c \
-MD -dependency-file ./get_toc_byte_sex.d \
-o ./get_toc_byte_sex.o ../get_toc_byte_sex.c
../get_toc_byte_sex.c:25:16: No include path in which to find ar.h
I do have an ar.h, but it is in /usr/include rather than in any of the
directories given by the -I command lines. I can get past the error by
using:
make CFLAGS="-I/usr/include -I`pwd`/include"
but it fails again soon after...
cc -I/usr/include -I/Users/cmiss/Build/cctools-622.3/include -static
-DRLD -DSA_RLD -fno-builtin -finline -fno-keep-inline-functions
-fsigned-bitfields -force_cpusubtype_ALL -msoft-float -nostdinc
-I/System/Library/Frameworks/Kernel.framework/PrivateHeaders/libsa
-I/System/Library/Frameworks/Kernel.framework/PrivateHeaders
-I/System/Library/Frameworks/Kernel.framework/Headers/libsa
-I/System/Library/Frameworks/Kernel.framework/Headers/bsd
-I/System/Library/Frameworks/Kernel.framework/Headers -DKERNEL
-DKERNEL_PRIVATE -DAPPLE -DNeXT -DLIBSA_PRIVATE -c \
-MD -dependency-file ./best_arch.d \
-o ./best_arch.o ../best_arch.c
../best_arch.c: In function `cpusubtype_combine':
../best_arch.c:478: error: `CPU_TYPE_VEO' undeclared (first use in this
function)
../best_arch.c:478: error: (Each undeclared identifier is reported only once
../best_arch.c:478: error: for each function it appears in.)
../best_arch.c:483: error: `CPU_SUBTYPE_VEO_1' undeclared (first use in
this function)
../best_arch.c:484: error: `CPU_SUBTYPE_VEO_2' undeclared (first use in
this function)
grepping in /usr/include for CPU_TYPE_VEO doesn't find anything, and the
situation is even worse for the SDKs in /Developer/SDKs/ (I would like
to build against the oldest SDK possible). I can't find any mention of
how to do this in any past postings to this list.
How do I go about getting a working build of ld?
3) It is okay to just grab the gcc / ld binaries from my system? When I
downloaded Xcode, I had to click through a license saying I wouldn't
redistribute it, but I have since seen a license on Apple's site which
says it can be used on the terms of the Apple Public Source License,
which allows me to redistribute the code: "2.1 Unmodified Code. You may
use, reproduce, display, perform, internally distribute within Your
organization, and Externally Deploy verbatim, unmodified copies of the
Original Code, for commercial or non-commercial purposes, provided that
in each instance:" ...
Could someone (from Apple) please clarify which license applies to the
gcc and ld binaries from the Xcode 2.4? If anyone knows how portable
they are to older systems, that would also be useful.
Thanks and Best regards,
Andrew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden