summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authornoelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-25 20:30:52 +0000
committernoelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-25 20:30:52 +0000
commit7b80d8341edc7fe27b3dfc073c31a2a0336f1231 (patch)
tree8dab7e61ae4fc92d60f552409abc49d7f9e01fb0 /native_client_sdk
parentdd52bd1e5cc4174eff4212c0a61e1d8e1da8fb37 (diff)
downloadchromium_src-7b80d8341edc7fe27b3dfc073c31a2a0336f1231.zip
chromium_src-7b80d8341edc7fe27b3dfc073c31a2a0336f1231.tar.gz
chromium_src-7b80d8341edc7fe27b3dfc073c31a2a0336f1231.tar.bz2
Add ability to build SDK libs with Bionic
Add a bionic toolchain target to various support libraries in the NaCl SDK. Also updates tool scripts such as nacl_gcc.mk to support bionic builds. These changes require ENABLE_BIONIC=1 and should only affect the experimental bionic build of the NaCl SDK and not Chrome. BUG=345338 R=binji@chromium.org, sbc@chromium.org Review URL: https://codereview.chromium.org/171423017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253244 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rwxr-xr-xnative_client_sdk/src/build_tools/build_sdk.py3
-rw-r--r--native_client_sdk/src/libraries/gmock/library.dsc2
-rw-r--r--native_client_sdk/src/libraries/gtest/library.dsc2
-rw-r--r--native_client_sdk/src/libraries/jsoncpp/library.dsc2
-rw-r--r--native_client_sdk/src/libraries/ppapi_cpp/library.dsc2
-rw-r--r--native_client_sdk/src/libraries/ppapi_gles2/library.dsc2
-rw-r--r--native_client_sdk/src/libraries/sdk_util/library.dsc2
-rw-r--r--native_client_sdk/src/libraries/zlib/library.dsc2
-rw-r--r--native_client_sdk/src/resources/Makefile.library.template2
-rw-r--r--native_client_sdk/src/tools/common.mk12
-rwxr-xr-xnative_client_sdk/src/tools/nacl_config.py5
-rw-r--r--native_client_sdk/src/tools/nacl_gcc.mk25
12 files changed, 43 insertions, 18 deletions
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py
index 53c0f90..be5098e 100755
--- a/native_client_sdk/src/build_tools/build_sdk.py
+++ b/native_client_sdk/src/build_tools/build_sdk.py
@@ -979,8 +979,7 @@ def main(args):
BuildStepMakePepperDirs(pepperdir, ['include', 'toolchain', 'tools'])
BuildStepDownloadToolchains(toolchains)
BuildStepUntarToolchains(pepperdir, toolchains)
-
- BuildStepBuildToolchains(pepperdir, toolchains)
+ BuildStepBuildToolchains(pepperdir, toolchains)
BuildStepUpdateHelpers(pepperdir, True)
BuildStepUpdateUserProjects(pepperdir, toolchains,
diff --git a/native_client_sdk/src/libraries/gmock/library.dsc b/native_client_sdk/src/libraries/gmock/library.dsc
index 1f4c942..ff42a87 100644
--- a/native_client_sdk/src/libraries/gmock/library.dsc
+++ b/native_client_sdk/src/libraries/gmock/library.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl', 'linux', 'win'],
+ 'TOOLS': ['bionic', 'newlib', 'glibc', 'pnacl', 'linux', 'win'],
'SEARCH': [
'../../../../testing/gmock/include/gmock',
'../../../../testing/gmock/include/gmock/internal',
diff --git a/native_client_sdk/src/libraries/gtest/library.dsc b/native_client_sdk/src/libraries/gtest/library.dsc
index d0d6d0d..ab5a20c 100644
--- a/native_client_sdk/src/libraries/gtest/library.dsc
+++ b/native_client_sdk/src/libraries/gtest/library.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win', 'linux'],
+ 'TOOLS': ['bionic', 'newlib', 'glibc', 'pnacl', 'win', 'linux'],
'SEARCH': [
'.',
'../../../../testing/gtest/include/gtest',
diff --git a/native_client_sdk/src/libraries/jsoncpp/library.dsc b/native_client_sdk/src/libraries/jsoncpp/library.dsc
index 9ccc237..26f506a 100644
--- a/native_client_sdk/src/libraries/jsoncpp/library.dsc
+++ b/native_client_sdk/src/libraries/jsoncpp/library.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl', 'linux', 'win'],
+ 'TOOLS': ['bionic', 'newlib', 'glibc', 'pnacl', 'linux', 'win'],
'SEARCH': [
'../../../../third_party/jsoncpp/overrides/include/json',
'../../../../third_party/jsoncpp/overrides/src/lib_json',
diff --git a/native_client_sdk/src/libraries/ppapi_cpp/library.dsc b/native_client_sdk/src/libraries/ppapi_cpp/library.dsc
index 4546d29..ca0c06f 100644
--- a/native_client_sdk/src/libraries/ppapi_cpp/library.dsc
+++ b/native_client_sdk/src/libraries/ppapi_cpp/library.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win', 'linux'],
+ 'TOOLS': ['bionic', 'newlib', 'glibc', 'pnacl', 'win', 'linux'],
'SEARCH': [
'../../../../ppapi/cpp',
'../../../../ppapi/cpp/dev',
diff --git a/native_client_sdk/src/libraries/ppapi_gles2/library.dsc b/native_client_sdk/src/libraries/ppapi_gles2/library.dsc
index bddf8c6..6b8b21e 100644
--- a/native_client_sdk/src/libraries/ppapi_gles2/library.dsc
+++ b/native_client_sdk/src/libraries/ppapi_gles2/library.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl', 'linux', 'win'],
+ 'TOOLS': ['bionic', 'newlib', 'glibc', 'pnacl', 'linux', 'win'],
'SEARCH' : [
'../../../../ppapi/lib/gl/gles2',
'../../../../ppapi/lib/gl/include/EGL',
diff --git a/native_client_sdk/src/libraries/sdk_util/library.dsc b/native_client_sdk/src/libraries/sdk_util/library.dsc
index 7d14db1..4066d5b 100644
--- a/native_client_sdk/src/libraries/sdk_util/library.dsc
+++ b/native_client_sdk/src/libraries/sdk_util/library.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
+ 'TOOLS': ['bionic', 'newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'sdk_util',
diff --git a/native_client_sdk/src/libraries/zlib/library.dsc b/native_client_sdk/src/libraries/zlib/library.dsc
index 0354799..d7409e9 100644
--- a/native_client_sdk/src/libraries/zlib/library.dsc
+++ b/native_client_sdk/src/libraries/zlib/library.dsc
@@ -1,6 +1,6 @@
{
'DISABLE': True,
- 'TOOLS': ['newlib', 'glibc', 'linux', 'win'],
+ 'TOOLS': ['bionic', 'newlib', 'glibc', 'linux', 'win'],
'SEARCH': [
'../../../../third_party/zlib',
],
diff --git a/native_client_sdk/src/resources/Makefile.library.template b/native_client_sdk/src/resources/Makefile.library.template
index da4e67a..266642b 100644
--- a/native_client_sdk/src/resources/Makefile.library.template
+++ b/native_client_sdk/src/resources/Makefile.library.template
@@ -63,7 +63,7 @@ $(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
$(eval $(call LIB_RULE,$(TARGET),$(SOURCES)))
[[if target['TYPE'] != 'static-lib':]]
-ifeq ($(TOOLCHAIN),glibc)
+ifneq (,$(findstring $(TOOLCHAIN),glibc bionic))
$(eval $(call SO_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
endif
[[]]
diff --git a/native_client_sdk/src/tools/common.mk b/native_client_sdk/src/tools/common.mk
index b90fbaf..b491631 100644
--- a/native_client_sdk/src/tools/common.mk
+++ b/native_client_sdk/src/tools/common.mk
@@ -14,9 +14,13 @@
# your project only builds in one or the other then this should be overridden
# accordingly.
#
-VALID_TOOLCHAINS ?= pnacl newlib glibc
-TOOLCHAIN ?= $(word 1,$(VALID_TOOLCHAINS))
+ALL_TOOLCHAINS ?= pnacl newlib glibc
+ifneq ($(ENABLE_BIONIC),)
+ALL_TOOLCHAINS += bionic
+endif
+VALID_TOOLCHAINS ?= $(ALL_TOOLCHAINS)
+TOOLCHAIN ?= $(word 1,$(VALID_TOOLCHAINS))
#
# Top Make file, which we want to trigger a rebuild on if it changes
@@ -60,7 +64,7 @@ endef
#
# The target for all versions
#
-USABLE_TOOLCHAINS=$(filter $(OSNAME) pnacl newlib glibc,$(VALID_TOOLCHAINS))
+USABLE_TOOLCHAINS=$(filter $(OSNAME) $(ALL_TOOLCHAINS),$(VALID_TOOLCHAINS))
ifeq ($(NO_HOST_BUILDS),1)
USABLE_TOOLCHAINS:=$(filter-out $(OSNAME),$(USABLE_TOOLCHAINS))
@@ -411,7 +415,7 @@ ifneq (,$(findstring $(TOOLCHAIN),win))
include $(NACL_SDK_ROOT)/tools/host_vc.mk
endif
-ifneq (,$(findstring $(TOOLCHAIN),glibc newlib))
+ifneq (,$(findstring $(TOOLCHAIN),glibc newlib bionic))
include $(NACL_SDK_ROOT)/tools/nacl_gcc.mk
endif
diff --git a/native_client_sdk/src/tools/nacl_config.py b/native_client_sdk/src/tools/nacl_config.py
index b508cba..9429468 100755
--- a/native_client_sdk/src/tools/nacl_config.py
+++ b/native_client_sdk/src/tools/nacl_config.py
@@ -44,7 +44,7 @@ ARCH_BASE_NAME = {
'x86_64': 'x86'
}
-NACL_TOOLCHAINS = ('newlib', 'glibc', 'pnacl')
+NACL_TOOLCHAINS = ('newlib', 'glibc', 'pnacl', 'bionic')
HOST_TOOLCHAINS = ('linux', 'mac', 'win')
VALID_TOOLCHAINS = list(HOST_TOOLCHAINS) + list(NACL_TOOLCHAINS) + ['host']
@@ -119,7 +119,8 @@ def CheckValidToolchainArch(toolchain, arch, arch_required=False):
ExpectArch(arch, VALID_ARCHES)
if arch == 'arm':
- Expect(toolchain == 'newlib', 'The arm arch only supports newlib.')
+ Expect(toolchain in ['newlib', 'bionic'],
+ 'The arm arch only supports newlib.')
def GetArchName(arch):
diff --git a/native_client_sdk/src/tools/nacl_gcc.mk b/native_client_sdk/src/tools/nacl_gcc.mk
index 858c735..c5c1609 100644
--- a/native_client_sdk/src/tools/nacl_gcc.mk
+++ b/native_client_sdk/src/tools/nacl_gcc.mk
@@ -13,6 +13,7 @@
# We always link with the C++ compiler but include -Wl,-as-needed flag
# in LDFLAGS so the linker should drop libc++ unless it's actually needed.
#
+ifneq ($(TOOLCHAIN),bionic)
X86_32_CC := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=cc)
X86_32_CXX := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=c++)
X86_32_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=c++)
@@ -26,8 +27,9 @@ X86_64_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=c++)
X86_64_LIB := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=ar)
X86_64_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=strip)
X86_64_NM := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=nm)
+endif
-ifneq ($(TOOLCHAIN),glibc)
+ifeq (,$(findstring $(TOOLCHAIN),glibc))
ARM_CC := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=cc)
ARM_CXX := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=c++)
ARM_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=c++)
@@ -142,8 +144,10 @@ endef
# Determine which architectures to build for. The user can set NACL_ARCH or
# ARCHES in the environment to control this.
#
+ifneq ($(TOOLCHAIN),bionic)
VALID_ARCHES := x86_32 x86_64
-ifeq (newlib,$(TOOLCHAIN))
+endif
+ifneq (glibc,$(TOOLCHAIN))
VALID_ARCHES += arm
endif
@@ -207,6 +211,23 @@ GLIBC_SO_LIST += $(OUTDIR)/lib$(1)_x86_64.so
GLIBC_REMAP += -n lib$(1)_x86_64.so,lib$(1).so
endif
endif
+
+ifneq (,$(findstring arm,$(ARCHES)))
+all: $(OUTDIR)/lib$(1)_arm.so
+$(OUTDIR)/lib$(1)_arm.so: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm_pic)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
+ $(call LOG,LINK,$$@,$(ARM_LINK) -o $$@ $$(filter %.o,$$^) $(LDFLAGS_SHARED) -marm $(NACL_LDFLAGS) $(ARM_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(TOOLCHAIN)_arm/$(CONFIG)) $(foreach lib,$(3),-l$(lib)))
+ $(call LOG,VALIDATE,$$@,$(NCVAL) $$@)
+
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).so
+install: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).so
+$(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).so: $(OUTDIR)/lib$(1)_arm.so
+ $(MKDIR) -p $$(dir $$@)
+ $(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@)
+ifneq ($(6),1)
+GLIBC_SO_LIST += $(OUTDIR)/lib$(1)_arm.so
+GLIBC_REMAP += -n lib$(1)_arm.so,lib$(1).so
+endif
+endif
endef
#