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

fix for freebsd. #51

Merged
merged 3 commits into from
Sep 17, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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