From 2fb843bb0feb1e103caafd978e2cd1ae0fdf4658 Mon Sep 17 00:00:00 2001 From: "mirandac@chromium.org" Date: Thu, 12 Aug 2010 02:11:08 +0000 Subject: 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 --- build/common.gypi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'build/common.gypi') 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}, -- cgit v1.1