Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #51 from andreacgranata/master
Browse files Browse the repository at this point in the history
fix for freebsd.
  • Loading branch information
cowboyd committed Sep 17, 2012
2 parents 34890f5 + 7b42007 commit 14db91f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ task :checkout do
# Fix gyp trying to build platform-linux on FreeBSD 9 and FreeBSD 10.
# Based on: https://chromiumcodereview.appspot.com/10079030/patch/1/2
sh "patch -N -p0 -d vendor/v8 < patches/add-freebsd9-and-freebsd10-to-gyp-GetFlavor.patch"
sh "patch -N -p1 -d vendor/v8 < patches/fPIC-on-linux-x64.patch"
sh "patch -N -p1 -d vendor/v8 < patches/fPIC-on-x64.patch"
sh "patch -N -p1 -d vendor/v8 < patches/gcc42-on-freebsd.patch" if RUBY_PLATFORM.include?("freebsd") && !system("pkg_info | grep gcc-4")
end

desc "compile v8 via the ruby extension mechanism"
Expand Down
14 changes: 14 additions & 0 deletions patches/fPIC-on-x64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/build/standalone.gypi b/build/standalone.gypi
index ebdf557..c7a59bc 100644
--- a/build/standalone.gypi
+++ b/build/standalone.gypi
@@ -98,6 +98,9 @@
[ 'OS=="linux"', {
'cflags': [ '-ansi' ],
}],
+ [ '(OS=="linux" or OS=="freebsd") and v8_target_arch=="x64" and component=="static_library"', {
+ 'cflags': [ '-fPIC' ],
+ }],
[ 'visibility=="hidden"', {
'cflags': [ '-fvisibility=hidden' ],
}],
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ index ebdf557..c7a59bc 100644
[ 'OS=="linux"', {
'cflags': [ '-ansi' ],
}],
+ [ 'OS=="linux" and v8_target_arch=="x64" and component=="static_library"', {
+ 'cflags': [ '-fPIC', ],
+ [ 'OS=="freebsd"', {
+ 'cflags': [ '-fno-strict-aliasing', ],
+ }],
[ 'visibility=="hidden"', {
'cflags': [ '-fvisibility=hidden' ],
Expand Down

0 comments on commit 14db91f

Please sign in to comment.