diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 02:11:08 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 02:11:08 +0000 |
commit | 2fb843bb0feb1e103caafd978e2cd1ae0fdf4658 (patch) | |
tree | 87167b89d000f634897e48cac4aa4fd778d4e900 | |
parent | ab23dbedf7ff80bc6de6cb4da5d6d965f5525a4d (diff) | |
download | chromium_src-2fb843bb0feb1e103caafd978e2cd1ae0fdf4658.zip chromium_src-2fb843bb0feb1e103caafd978e2cd1ae0fdf4658.tar.gz chromium_src-2fb843bb0feb1e103caafd978e2cd1ae0fdf4658.tar.bz2 |
Revert 55766 - Enable -fPIC by default on x64
Get rid of linux_fpic gyp variable.
BUG=26625
TEST=all linux builds should compile
Review URL: http://codereview.chromium.org/3135001
TBR=nirnimesh@chromium.org
Review URL: http://codereview.chromium.org/3150006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55836 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | build/common.gypi | 13 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 8 | ||||
-rw-r--r-- | gpu/demos/demos.gyp | 11 |
3 files changed, 27 insertions, 5 deletions
diff --git a/build/common.gypi b/build/common.gypi index 0617a5c..c27dc75 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -111,6 +111,10 @@ # compilation. 'fastbuild%': 0, + # Set to 1 compile with -fPIC cflag on linux. This is a must for shared + # libraries on linux x86-64 and arm. + 'linux_fpic%': 0, + # Python version. 'python_ver%': '2.5', @@ -150,6 +154,7 @@ 'touchui%': '<(touchui)', 'inside_chromium_build%': '<(inside_chromium_build)', 'fastbuild%': '<(fastbuild)', + 'linux_fpic%': '<(linux_fpic)', 'python_ver%': '<(python_ver)', 'armv7%': '<(armv7)', 'arm_neon%': '<(arm_neon)', @@ -1082,7 +1087,7 @@ }], ], }], - ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', { + ['linux_fpic==1', { 'cflags': [ '-fPIC', ], @@ -1114,6 +1119,12 @@ # When building with shared libraries, remove the visiblity-hiding # flag. 'cflags!': [ '-fvisibility=hidden' ], + 'conditions': [ + ['target_arch=="x64" or target_arch=="arm"', { + # Shared libraries need -fPIC on x86-64 and arm + 'cflags': ['-fPIC'] + }] + ], }], ['linux_use_heapchecker==1', { 'variables': {'linux_use_tcmalloc%': 1}, diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 0c558d3..90a1155 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -480,6 +480,10 @@ 'test/nacl_security_tests/nacl_security_tests_win.cc', ], },], + # set fPIC for linux in case it isn't set. + ['OS=="linux" and (target_arch=="x64" or target_arch=="arm") and linux_fpic!=1', { + 'cflags': ['-fPIC'], + },], ], }, { @@ -2476,8 +2480,10 @@ }, ]}, # 'targets' ], # OS=="win" + # Build on linux x86_64 only if linux_fpic==1 ['OS=="mac" or (OS=="win" and component=="static_library") ' - 'or (OS=="linux" and target_arch==python_arch)', { + 'or (OS=="linux" and target_arch==python_arch ' + 'and (target_arch!="x64" or linux_fpic==1))', { 'targets': [ { # Documentation: http://dev.chromium.org/developers/pyauto diff --git a/gpu/demos/demos.gyp b/gpu/demos/demos.gyp index 02a4d50..a7ba2b9 100644 --- a/gpu/demos/demos.gyp +++ b/gpu/demos/demos.gyp @@ -6,10 +6,15 @@ 'variables': { 'chromium_code': 1, 'conditions': [ - ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', { - 'enable_pepper_demos%': 1, - }, { + # Pepper demos that are compiled as shared libraries need to be compiled + # with -fPIC flag. All static libraries that these demos depend on must + # also be compiled with -fPIC flag. Setting GYP_DEFINES="linux_fpic=1" + # compiles everything with -fPIC. Disable pepper demos on linux/x64 + # unless linux_fpic is 1. + ['OS=="linux" and (target_arch=="x64" or target_arch=="arm") and linux_fpic!=1', { 'enable_pepper_demos%': 0, + }, { + 'enable_pepper_demos%': 1, }], ], }, |