Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / native_client / tools / Makefile
index 353f2d3..df922ac 100644 (file)
@@ -433,14 +433,7 @@ GCC_CONFIGURE_FLAGS-nolibc = --disable-shared \
                             --enable-languages="c" \
                             --without-headers
 
-# The newlib-based build of the GCC target libraries (libstdc++ et al)
-# gets used in irt.nexe, which must not use direct register access for
-# TLS.  src/untrusted/irt/nacl.scons:run_irt_tls_test ensures that no
-# such accesses leaked into that binary.  The pregcc build does not
-# produce target libraries that are linked into anything, and the glibc
-# build is not used for building irt.nexe, so they do not need this option.
-GCC_CFLAGS_FOR_TARGET-newlib = -mtls-use-call \
-                              -I$(HEADERS_FOR_BUILD)
+GCC_CFLAGS_FOR_TARGET-newlib = -I$(HEADERS_FOR_BUILD)
 
 GCC_CONFIGURE_FLAGS-newlib = --disable-shared \
                             --enable-languages="c,c++,objc" \
@@ -557,7 +550,7 @@ endif
 # by the Native Client threads package build.
 ##################################################################
 
-NEWLIB_CFLAGS = -O2 -D_I386MACH_ALLOW_HW_INTERRUPTS -mtls-use-call
+NEWLIB_CFLAGS = -O2
 
 BUILD/stamp-$(CROSSARCH)-newlib: | SRC/newlib BUILD newlib-libc-script
        rm -rf BUILD/build-newlib-$(CROSSARCH)
@@ -567,8 +560,8 @@ BUILD/stamp-$(CROSSARCH)-newlib: | SRC/newlib BUILD newlib-libc-script
          ../../SRC/newlib/configure \
                      --disable-libgloss \
                      --enable-newlib-iconv \
-                     --enable-newlib-iconv-from-encodings=UTF-8,UTF-16,UCS-4 \
-                     --enable-newlib-iconv-to-encodings=UTF-8,UTF-16,UCS-4 \
+                     --enable-newlib-iconv-from-encodings=UTF-8,UTF-16LE,UCS-4LE,UTF-16,UCS-4 \
+                     --enable-newlib-iconv-to-encodings=UTF-8,UTF-16LE,UCS-4LE,UTF-16,UCS-4 \
                      --enable-newlib-io-long-long \
                      --enable-newlib-io-long-double \
                      --enable-newlib-io-c99-formats \
@@ -581,12 +574,20 @@ BUILD/stamp-$(CROSSARCH)-newlib: | SRC/newlib BUILD newlib-libc-script
          $(MAKE) && \
          $(MAKE) DESTDIR=$(DESTDIR) install
 ifeq ($(CANNED_REVISION), no)
-       rm $(DESTDIR)$(PREFIX)/$(CROSSARCH)/include/pthread.h
+# The buildbot script that creates the source tarball adds all the headers to
+# the tarball itself (see buildbot/buildbot_linux-glibc-makefile.sh)
+       cp -f $(addprefix ../src/untrusted/pthread/, pthread.h semaphore.h) \
+         $(DESTDIR)$(PREFIX)/$(CROSSARCH)/include
 endif
        for bits in 32 64; do \
          mv $(DESTDIR)$(PREFIX)/$(CROSSARCH)/lib$$bits/libc.a \
             $(DESTDIR)$(PREFIX)/$(CROSSARCH)/lib$$bits/libcrt_common.a; \
-         sed "s/@OBJFORMAT@/elf$${bits}-nacl/" newlib-libc-script \
+         if [[ "$$bits" = "32" ]]; then \
+           objformat=elf32-i386-nacl ; \
+         else \
+           objformat=elf64-x86-64-nacl ; \
+         fi ; \
+         sed "s/@OBJFORMAT@/$$objformat/" newlib-libc-script \
            > $(DESTDIR)$(PREFIX)/$(CROSSARCH)/lib$$bits/libc.a; \
        done
        touch $@
@@ -631,6 +632,7 @@ BUILD/stamp-glibc32: BUILD/stamp-$(CROSSARCH)-pregcc-standalone | SRC/glibc
            libc_cv_forced_unwind=yes \
            libc_cv_c_cleanup=yes \
            libc_cv_slibdir=/lib32 \
+           libc_cv_z_combreloc=no \
            --prefix= \
            --libdir=/lib32 \
            --host=i486-linux-gnu \
@@ -653,6 +655,7 @@ BUILD/stamp-glibc64: BUILD/stamp-$(CROSSARCH)-pregcc-standalone | SRC/glibc
            libc_cv_forced_unwind=yes \
            libc_cv_c_cleanup=yes \
            libc_cv_slibdir=/lib \
+           libc_cv_z_combreloc=no \
            --prefix= \
            --libdir=/lib \
            --host=x86_64-linux-gnu \