Created
March 22, 2012 17:17
-
-
Save fdmanana/2160061 to your computer and use it in GitHub Desktop.
OS X 64bits release target
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 0a8c3023b5c29463b58d09fc574c5f8f3bd36b99 Mon Sep 17 00:00:00 2001 | |
From: Filipe David Borba Manana <[email protected]> | |
Date: Fri, 23 Mar 2012 13:48:15 +0000 | |
Subject: [PATCH] Add support for Mac OS X 64bit builds with GYP | |
Note that in order to build for 64bits mode, you'll have | |
to specify the target architecture explicitely, the default | |
is still 32bits for Mac OS X. | |
Example with make: | |
$ export GYP_GENERATORS=make | |
$ make dependencies | |
$ make -j 8 library=shared x64.release | |
Example with make and clang: | |
$ export GYP_GENERATORS=make | |
$ export CC=/usr/bin/clang | |
$ export CXX=/usr/bin/clang++ | |
$ export GYP_DEFINES="clang=1" | |
$ make dependencies | |
$ make -j 8 library=shared x64.release | |
Example with xcode: | |
$ export GYP_GENERATORS=xcode | |
$ build/gyp_v8 -Dtarget_arch=x64 | |
$ xcodebuild -project build/all.xcodeproj -configuration Release | |
Contributed by Filipe David Manana <[email protected]> | |
--- | |
Makefile | 2 +- | |
build/common.gypi | 22 ++++++++++++++++++++++ | |
build/gyp_v8 | 7 ++++++- | |
tools/gyp/v8.gyp | 10 ++++++++-- | |
4 files changed, 37 insertions(+), 4 deletions(-) | |
diff --git a/Makefile b/Makefile | |
index 5dc6ca5..e4e36d8 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -260,4 +260,4 @@ $(ENVFILE).new: | |
# Dependencies. | |
dependencies: | |
svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ | |
- --revision 1026 | |
+ --revision 1251 | |
diff --git a/build/common.gypi b/build/common.gypi | |
index 5c0c323..4f2452c 100644 | |
--- a/build/common.gypi | |
+++ b/build/common.gypi | |
@@ -317,6 +317,16 @@ | |
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter', | |
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ], | |
}], | |
+ ['OS=="mac" and target_arch=="ia32"', { | |
+ 'xcode_settings': { | |
+ 'ARCHS': ['i386'] | |
+ } | |
+ }], | |
+ ['OS=="mac" and target_arch=="x64"', { | |
+ 'xcode_settings': { | |
+ 'ARCHS': ['x86_64'] | |
+ } | |
+ }], | |
], | |
}, # Debug | |
'Release': { | |
@@ -358,6 +368,18 @@ | |
# is specified explicitly. | |
'GCC_STRICT_ALIASING': 'YES', | |
}, | |
+ 'conditions': [ | |
+ ['target_arch=="ia32"', { | |
+ 'xcode_settings': { | |
+ 'ARCHS': ['i386'] | |
+ } | |
+ }], | |
+ ['target_arch=="x64"', { | |
+ 'xcode_settings': { | |
+ 'ARCHS': ['x86_64'] | |
+ } | |
+ }], | |
+ ], | |
}], # OS=="mac" | |
['OS=="win"', { | |
'msvs_configuration_attributes': { | |
diff --git a/build/gyp_v8 b/build/gyp_v8 | |
index 4293e76..54f3f7f 100755 | |
--- a/build/gyp_v8 | |
+++ b/build/gyp_v8 | |
@@ -156,7 +156,12 @@ if __name__ == '__main__': | |
# Generate for the architectures supported on the given platform. | |
gyp_args = list(args) | |
- gyp_args.append('-Dtarget_arch=ia32') | |
+ target_arch = None | |
+ for p in gyp_args: | |
+ if p.find('-Dtarget_arch=') == 0: | |
+ target_arch = p | |
+ if target_arch is None: | |
+ gyp_args.append('-Dtarget_arch=ia32') | |
if utils.GuessOS() == 'linux': | |
gyp_args.append('-S-ia32') | |
run_gyp(gyp_args) | |
diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp | |
index 764789a..2913cdf 100644 | |
--- a/tools/gyp/v8.gyp | |
+++ b/tools/gyp/v8.gyp | |
@@ -59,6 +59,9 @@ | |
'../../src/v8dll-main.cc', | |
], | |
'conditions': [ | |
+ ['OS=="mac"', { | |
+ 'xcode_settings': {'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']}, | |
+ }], | |
['OS=="win"', { | |
'defines': [ | |
'BUILDING_V8_SHARED', | |
@@ -536,7 +539,7 @@ | |
'../../src/arm/stub-cache-arm.cc', | |
], | |
}], | |
- ['v8_target_arch=="ia32" or v8_target_arch=="mac" or OS=="mac"', { | |
+ ['v8_target_arch=="ia32"', { | |
'sources': [ | |
'../../src/ia32/assembler-ia32-inl.h', | |
'../../src/ia32/assembler-ia32.cc', | |
@@ -601,7 +604,7 @@ | |
'../../src/mips/stub-cache-mips.cc', | |
], | |
}], | |
- ['v8_target_arch=="x64" or v8_target_arch=="mac" or OS=="mac"', { | |
+ ['v8_target_arch=="x64"', { | |
'sources': [ | |
'../../src/x64/assembler-x64-inl.h', | |
'../../src/x64/assembler-x64.cc', | |
@@ -982,6 +985,9 @@ | |
}, { | |
'toolsets': ['target'], | |
}], | |
+ ['OS=="mac" and component=="shared_library"', { | |
+ 'xcode_settings': {'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']}, | |
+ }], | |
], | |
'link_settings': { | |
'libraries': [ | |
-- | |
1.7.9.1 |
Tried this with both Apple's llvm'ed gcc, standard gcc and clang++. All worked.
What if you do exactly the following steps:
$ export GYP_GENERATORS=make
$ make dependencies
$ make -j 8 library=shared x64.release
?
Filipe,
Unfortunately, i'm not interested in the shared library and don't have time
to investigate it much, but i'll give it a go when i find time and let you
know the result
Regards,
Jean-Philippe
On Fri, Mar 30, 2012 at 7:47 AM, Filipe Manana < ***@***.*** > wrote:
Tried this with both Apple's llvm'ed gcc, standard gcc and clang++. All
worked.
What if you do exactly the following steps:
$ export GYP_GENERATORS=make
$ make dependencies
$ make -j 8 library=shared x64.release
?
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2160061
##
_Jean-Philippe Lemieux_, Software Developer,
Macadamianhttp://www.macadamian.com/
o: 819.772.0300 x109 | e: [email protected]
User Experience Design http://www.macadamian.com/services/design/ - Product
Strategy http://www.macadamian.com/services/strategy_research/ - Software
Engineering http://www.macadamian.com/services/development/
Useful, desirable software; from napkin sketch to market ready.
Filipe,
I ran the commands as you asked, the build seemed to complete without
errors, but there doesn't seem to be a shared library produced in the top
folder. Maybe i was looking for the wrong thing in the wrong place?
Regards,
Jean-Philippe
On Fri, Mar 30, 2012 at 5:25 PM, Jean-Philippe Lemieux <
[email protected]> wrote:
Filipe,
Unfortunately, i'm not interested in the shared library and don't have
time to investigate it much, but i'll give it a go when i find time and let
you know the result
Regards,
Jean-Philippe
On Fri, Mar 30, 2012 at 7:47 AM, Filipe Manana <
***@***.***
> wrote:
>
> Tried this with both Apple's llvm'ed gcc, standard gcc and clang++. All
> worked.
> What if you do exactly the following steps:
>
> $ export GYP_GENERATORS=make
> $ make dependencies
> $ make -j 8 library=shared x64.release
>
> ?
> ---
>
> Reply to this email directly or view it on GitHub:
> https://gist.github.com/2160061
##
_Jean-Philippe Lemieux_, Software Developer, Macadamianhttp://www.macadamian.com/
o: 819.772.0300 x109 | e: ***@***.***
User Experience Design http://www.macadamian.com/services/design/ - Product
Strategy http://www.macadamian.com/services/strategy_research/ - Software
Engineering http://www.macadamian.com/services/development/
Useful, desirable software; from napkin sketch to market ready.
##
_Jean-Philippe Lemieux_, Software Developer,
Macadamianhttp://www.macadamian.com/
o: 819.772.0300 x109 | e: [email protected]
User Experience Design http://www.macadamian.com/services/design/ - Product
Strategy http://www.macadamian.com/services/strategy_research/ - Software
Engineering http://www.macadamian.com/services/development/
Useful, desirable software; from napkin sketch to market ready.
Should be inside out/x64.release (or out/x64.debug if you build in debug mode).
On Mon, Apr 2, 2012 at 3:41 PM, jpl-mac
[email protected]
wrote:
Filipe,
I ran the commands as you asked, the build seemed to complete without
errors, but there doesn't seem to be a shared library produced in the top
folder. Maybe i was looking for the wrong thing in the wrong place?
Regards,
Jean-Philippe
On Fri, Mar 30, 2012 at 5:25 PM, Jean-Philippe Lemieux <
***@***.***> wrote:
> Filipe,
>
> Unfortunately, i'm not interested in the shared library and don't have
> time to investigate it much, but i'll give it a go when i find time and let
> you know the result
>
> Regards,
> Jean-Philippe
>
> On Fri, Mar 30, 2012 at 7:47 AM, Filipe Manana <
> ***@***.***
>
> > wrote:
> >
> > Tried this with both Apple's llvm'ed gcc, standard gcc and clang++. All
> > worked.
> > What if you do exactly the following steps:
> >
> > $ export GYP_GENERATORS=make
> > $ make dependencies
> > $ make -j 8 library=shared x64.release
> >
> > ?
> > ---
> >
> > Reply to this email directly or view it on GitHub:
> > https://gist.github.com/2160061
> ##
>
> _Jean-Philippe Lemieux_, Software Developer, Macadamianhttp://www.macadamian.com/
> o: 819.772.0300 x109 | e: ***@***.***
>
> User Experience Design http://www.macadamian.com/services/design/ - Product
> Strategy http://www.macadamian.com/services/strategy_research/ - Software
> Engineering http://www.macadamian.com/services/development/
> Useful, desirable software; from napkin sketch to market ready.
##
_Jean-Philippe Lemieux_, Software Developer,
Macadamianhttp://www.macadamian.com/
o: 819.772.0300 x109 | e: ***@***.***
User Experience Design http://www.macadamian.com/services/design/ - Product
Strategy http://www.macadamian.com/services/strategy_research/ - Software
Engineering http://www.macadamian.com/services/development/
Useful, desirable software; from napkin sketch to market ready.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2160061
##
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Didn't work for me with
make -j8 x64
Still get "ld: symbol(s) not found for architecture i386"