Reviewers: Benedikt Meurer,

Message:
This is the other half of https://codereview.chromium.org/513923005/, but we
can't land this at the moment, because of various PNaCL toolchain bugs. :-/ Just
for reference and future use...

Description:
GYP/Makefile changes for PNaCL.

Please review this at https://codereview.chromium.org/521593002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+25, -28 lines):
  M Makefile.nacl
  M tools/gyp/v8.gyp


Index: Makefile.nacl
diff --git a/Makefile.nacl b/Makefile.nacl
index 34bd960fed1cb5bfcaf9fe3336724076c75ac9bd..07ef39030e6e8e4fd8bb761911c7be2aa9c7584e 100644
--- a/Makefile.nacl
+++ b/Makefile.nacl
@@ -36,41 +36,29 @@ NACL_BUILDS = $(foreach mode,$(MODES), \
                    $(addsuffix .$(mode),$(NACL_ARCHES)))

 HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
-ifeq ($(HOST_OS), linux)
-  TOOLCHAIN_DIR = linux_x86_glibc
-else
-  ifeq ($(HOST_OS), mac)
-    TOOLCHAIN_DIR = mac_x86_glibc
-  else
-    $(error Host platform "${HOST_OS}" is not supported)
-  endif
-endif
-
 TOOLCHAIN_PATH = $(realpath ${NACL_SDK_ROOT}/toolchain)
-NACL_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR}
+NACL_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/linux_pnacl
+
+ifeq ($(wildcard $(NACL_TOOLCHAIN)),)
+  $(error Cannot find Native Client toolchain in "${NACL_TOOLCHAIN}")
+endif

 ifeq ($(ARCH), nacl_ia32)
   GYPENV = nacl_target_arch=nacl_ia32 v8_target_arch=arm v8_host_arch=ia32
-  TOOLCHAIN_ARCH = x86-4.4
-  NACL_CC = "$(NACL_TOOLCHAIN)/bin/i686-nacl-gcc"
-  NACL_CXX = "$(NACL_TOOLCHAIN)/bin/i686-nacl-g++"
-  NACL_LINK = "$(NACL_TOOLCHAIN)/bin/i686-nacl-g++"
+ NACL_CC = "$(NACL_TOOLCHAIN)/bin/pnacl-clang --pnacl-allow-translate -arch x86-32 -target i686-unknown-nacl" + NACL_CXX = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++ --pnacl-allow-translate -arch x86-32 -target i686-unknown-nacl" + NACL_LINK = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++ --pnacl-allow-native -arch x86-32 -Wt,--noirtshim"
 else
   ifeq ($(ARCH), nacl_x64)
     GYPENV = nacl_target_arch=nacl_x64 v8_target_arch=arm v8_host_arch=ia32
-    TOOLCHAIN_ARCH = x86-4.4
-    NACL_CC = "$(NACL_TOOLCHAIN)/bin/x86_64-nacl-gcc"
-    NACL_CXX = "$(NACL_TOOLCHAIN)/bin/x86_64-nacl-g++"
-    NACL_LINK = "$(NACL_TOOLCHAIN)/bin/x86_64-nacl-g++"
+ NACL_CC = "$(NACL_TOOLCHAIN)/bin/pnacl-clang --pnacl-allow-translate -arch x86-64 -target x86_64-none-nacl-gnu" + NACL_CXX = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++ --pnacl-allow-translate -arch x86-64 -target x86_64-none-nacl-gnu" + NACL_LINK = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++ --pnacl-allow-native -arch x86-64 -Wt,--noirtshim"
   else
     $(error Target architecture "${ARCH}" is not supported)
   endif
 endif

-ifeq ($(wildcard $(NACL_TOOLCHAIN)),)
-  $(error Cannot find Native Client toolchain in "${NACL_TOOLCHAIN}")
-endif
-
 # For mksnapshot host generation.
 GYPENV += host_os=${HOST_OS}

@@ -97,6 +85,7 @@ $(NACL_MAKEFILES):
        GYP_DEFINES="${GYPENV}" \
        CC=${NACL_CC} \
        CXX=${NACL_CXX} \
+       LINK=${NACL_LINK} \
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH)" \
        build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \
                      -Ibuild/standalone.gypi --depth=. \
Index: tools/gyp/v8.gyp
diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp
index bdb487ad746bfc8f4e160bc3b31ad0ba6fa4cfdc..011f5ea46f42927005f575b0d58d3c69a1be2e6e 100644
--- a/tools/gyp/v8.gyp
+++ b/tools/gyp/v8.gyp
@@ -1164,11 +1164,19 @@
           'toolsets': ['target'],
         }],
         ['OS=="linux"', {
-            'link_settings': {
-              'libraries': [
-                '-lrt'
-              ]
-            },
+            'conditions': [
+              ['nacl_target_arch=="none"', {
+                'link_settings': {
+                  'libraries': [
+                    '-lrt'
+                  ],
+                },
+              }, {
+                'defines': [
+                  'V8_LIBRT_NOT_AVAILABLE=1',
+                ],
+              }],
+            ],
             'sources': [
               '../../src/base/platform/platform-linux.cc',
               '../../src/base/platform/platform-posix.cc'


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to