This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pass -isysroot to linker on darwin


You can now do

gcc -isysroot /Developer/SDKs/MacOSX10.4.0.sdk foo.c -o foo

to build a program using the MacOS SDK mechanism (each SDK is a
sysroot).

Previously you had to use -Wl,-syslibroot,..., which was fine, except
that you couldn't just say "CC=gcc -isysroot ... -Wl,..." because that
caused an error when building .o files.  Now it Just Works.

Bootstrapped and tested on powerpc-darwin8, plus I checked that a line
similar to the above works and loads the right libraries (using
-Wl,-whatsloaded).

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-darwin-syslibroot-1.patch=============
2005-06-03  Geoffrey Keating  <geoffk@apple.com>

	* config/darwin.h (LINK_SPEC): Pass -syslibroot to linker
	when -isysroot passed.

Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.120
diff -u -p -u -p -r1.120 darwin.h
--- config/darwin.h	26 May 2005 23:19:29 -0000	1.120
+++ config/darwin.h	3 Jun 2005 23:14:54 -0000
@@ -275,6 +275,7 @@ Boston, MA 02111-1307, USA.  */
    %{Zseg_addr_table*: -seg_addr_table %*} \
    %{Zseg_addr_table_filename*:-seg_addr_table_filename %*} \
    %{sub_library*} %{sub_umbrella*} \
+   %{isysroot*:-syslibroot %*} \
    %{twolevel_namespace} %{twolevel_namespace_hints} \
    %{umbrella*} \
    %{undefined*} \
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]