When working on commit 6a09a69ec9
("build: enable cctest to use generated objects") I did not take into
account building with ninja:
$ ./configure
$ tools/gyp_node.py -f ninja
$ ninja -C out/Release
$ ln -fs out/Release/node node
When ninja generated the ninja build files, src files that are
relative to the src directory will be named with a dot instead of a
path separator, for example:
out/Release/obj/src/node/node.o
would instead become:
out/Release/obj/src/node.node.o
This commit adds an additional variable for the type of object separator
used for this case.
Currently the check for if ninja is being used is a normal if statement
as are the following os checks (win and aix). But the win and aix ones
should only be evaluated if the build is not generated by ninja.
This commit turns this logic into an if ninja else statement.
PR-URL: https://github.com/nodejs/node/pull/12484
Fixes: https://github.com/nodejs/node/issues/12448
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Define `V8_ENABLE_CHECKS` in `common.gypi` for the debug mode.
Without this, these checks would only be present in the object files
generated from the V8 build, and so for inline functions in v8.h
multiple different definitions could be generated, where one definition
includes the check and the other does not.
Refs: https://github.com/nodejs/node/pull/11975#discussion_r108005423
PR-URL: https://github.com/nodejs/node/pull/12029
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
This commit tries to make it simpler to add unit tests (cctest) for
code that needs to test node core funtionality but that might not be
appropriate as an addon or a JavaScript test. An example of this could
be adding functionality targeted for situations when Node itself is
embedded.
Currently it was not as easy, or efficient, as one would have hoped to
add such tests. The object output directories vary for different
operating systems which we need to link to so that we don't have an
additional compilation step.
PR-URL: https://github.com/nodejs/node/pull/11956
Ref: https://github.com/nodejs/node/pull/9163
Reviewed-By: James M Snell <jasnell@gmail.com>
I think there might be an issue with the value of OBJ_DIR when
using a "mac" os. The value is currently specified in common.gypi
which is included by node.gyp:
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
In the generated Makefile (out/Makefile) the object output directory
is:
obj := $(builddir)/obj
And in the included node.target.mk we have the OBJS declared:
OBJS := \
$(obj).target/$(TARGET)/src/async-wrap.o \
$(obj).target/$(TARGET)/src/cares_wrap.o \
If OBJ_DIR is used in node.gyp to point to generated object files
on mac they will not be found.
PR-URL: https://github.com/nodejs/node/pull/11857
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/11730
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
On Linux, `ninja` appears to place `libv8_base.a` inside `OBJ_DIR`, as opposed
to `ninja` on OS X which places it outside of that directory. Furthermore, the
expected `OBJ_DIR` value (`obj.target/`) is actually just `obj/` for `ninja`.
This patch solves both of these issues by setting `OBJ_DIR` and `V8_BASE` to the
correct values for `ninja` on Linux specifically.
PR-URL: https://github.com/nodejs/node/pull/11348
Fixes: https://github.com/nodejs/node/issues/9861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Disable "warning C4267: conversion from 'size_t' to 'int', possible
loss of data". Many originate from our dependencies and their sheer
number drowns out other, more legitimate warnings.
PR-URL: https://github.com/nodejs/node/pull/11205
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
On OpenBSD 6.0 and greater W^X is enabled by default. All executables
that violate W^X need to be marked with PT_OPENBSD_WXNEEDED. In
addition to this, they must be executed from a filesystem mounted with
'wxallowed'.
More info on W^X: https://en.wikipedia.org/wiki/W%5EX
PR-URL: https://github.com/nodejs/node/pull/9232
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
V8 now depends on C++11 runtime features. On OSX this requires us to
link against the libc++ library rather than the deprecated default
that is provided with -mmacosx-version-min=10.7.
PR-URL: https://github.com/nodejs/node/pull/8317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
v8.gyp expects this to be defined by the embedder
PR-URL: https://github.com/nodejs/node/pull/8317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
The location of various gypfiles has changed in V8 5.2.
PR-URL: https://github.com/nodejs/node/pull/8317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Thin archives were disabled in 2012 as a workaround (IIRC) for obsolete
tooling on one of Joyent's platforms. The last binutils versions that
didn't support them was released in 2007 so I think it's safe to assume
we can drop support for that now - except on SmartOS, where the tooling
still has a distinctive vintage feel to it.
Thin archives save space - it shrinks the size of PRODUCT_DIR by 30% -
and speed up the final linking step because it doesn't have to assemble
50 MB of static archives (twice! - first to create the archive, then to
copy it to PRODUCT_DIR). The archives are just 3.5 MB now and no longer
copied around.
PR-URL: https://github.com/nodejs/node/pull/7957
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
Added "dll" option to vcbuild.bat
Insure that Unix SO name is not used on Windows (i.e. produce a .dll file)
Insure that Node and its V8 dependency link against the Visual C++ Runtime
dynamically.
Requires backported V8 patch, see PR 7802.
Ref: https://github.com/nodejs/node/pull/7802
PR-URL: https://github.com/nodejs/node/pull/7487
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
AIX linker has a table of contents with default size 64K
The recent code inclusions in V8 brings in lot of new
symbols which necessitates to increase this default.
Please note that the debug build already has this flag
Fixes: https://github.com/nodejs/node/issues/7500
PR-URL: https://github.com/nodejs/node/pull/7508
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Add configure flag for building a shared library that can be
embedded in other applications (like Electron). Add flags
--without-bundled-v8 and --without-v8-platform to control V8
dependencies used.
PR-URL: https://github.com/nodejs/node/pull/6994
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Commit 204f3a8 ("build: Bump MACOSX_DEPLOYMENT_TARGET to 10.7")
unwittingly turned on new ASLR features that make `-prof` unusable for
profiling C++ code, breaking `test/parallel/test-tick-processor.js` in
the process. Build with `-Wl,-no_pie` for now.
Fixes: https://github.com/nodejs/node/issues/5903
PR-URL: https://github.com/nodejs/node/pull/6453
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Turn off the custom toolchain, we don't bundle ld.gold. It's not that
useful anyway because it uses a fixed path. For people that do use a
custom toolchain, there is the GCC_EXEC_PREFIX environment variable.
PR-URL: https://github.com/nodejs/node/pull/6393
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Refs: https://github.com/nodejs/build/issues/367
libuv is going to drop 10.6 in v2.
Ref: https://github.com/libuv/libuv/pull/758
OS X versions below 10.9 are not supported by Apple anymore and do not
receive security patches.
PR-URL: https://github.com/nodejs/node/pull/6402
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Changes to Node core in order to allow compilation for linuxOne.
The ../archs/linux32-s390x/opensslconf.h and
../archs/linux64-s390x/opensslconf.h were automatically
generated by running make linux-ppc linux-ppc64 in the
deps/openssl/config directory as per our standard
practice
After these changes we still need a version of v8
which supports linuxOne but that will be coming soon
in the 5.1 version of v8. Until then with these changes
we'll be able to create a hybrid build which pulls in
v8 from the http://github/andrewlow repo.
PR-URL: https://github.com/nodejs/node/pull/5941
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Modified android-configure script to support also x86 arch.
Currently added support only for ia32 target arch.
Also, compile openssl without asm, since using the asm sources will make
node fail to run on Android, because it adds text relocations.
Signed-off-by: Robert Chiras <robert.chiras@intel.com>
PR-URL: https://github.com/nodejs/node/pull/5544
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
These are the core changes that allow AIX to compile. There
are still some test failures as there are some patches needed for
libuv and npm that we'll need to contribute through those
communities but this set allows node to be built on AIX and
pass most of the core tests
The change in js2c is because AIX does not support $ in
identifier names. See the discussion/agreement in
https://github.com/nodejs/node/issues/2272
PR-URL: https://github.com/nodejs/node/pull/2364
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
Reviewed-By: Rod Vagg <r@va.gg>
These are the core changes that allow pLinux BE/LE compile. They
don't include all of the changes needed for AIX which will follow
once we have pLinux up and running in the builds
PR-URL: https://github.com/nodejs/io.js/pull/2124
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
Reviewed-By: Johan Bergstrom <bugs@bergstroem.nu>
Support building and running with FIPS-compliant OpenSSL. The process is
following:
1. Download and verify `openssl-fips-x.x.x.tar.gz` from
https://www.openssl.org/source/
2. Extract source to `openssl-fips` folder
3. ``cd openssl-fips && ./config fipscanisterbuild --prefix=`pwd`/out``
(NOTE: On OS X, you may want to run
``./Configure darwin64-x86_64-cc --prefix=`pwd`/out`` if you are going to
build x64-mode io.js)
4. `make -j && make install`
5. Get into io.js checkout folder
6. `./configure --openssl-fips=/path/to/openssl-fips/out`
7. Build io.js with `make -j`
8. Verify with `node -p "process.versions.openssl"` (`1.0.2a-fips`)
Fix: https://github.com/joyent/node/issues/25463
PR-URL: https://github.com/nodejs/io.js/pull/1890
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
It's not supported by clang and commit e67542a ("build: disable -Og
when building with clang") is not sufficient because the configure
script no longer writes the 'clang' variable to common.gypi.
I could fix the configure script but I don't care enough actually do
so. A fixed configure script won't help anyway when the compiler is
overridden through the CXX environment variable at compile time.
PR-URL: https://github.com/iojs/io.js/pull/1611
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
The resulting binary is still easy to inspect in gdb but is not as dog
slow. The 'parallel' test suite, although it takes several minutes to
complete, now finishes without any tests timing out.
PR-URL: https://github.com/iojs/io.js/pull/1569
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
This commit applies a secondary change in order to make `make test`
pass cleanly, specifically re-disabling post-mortem debugging in
common.gypi.
PR-URL: https://github.com/iojs/io.js/pull/1506
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit applies some secondary changes in order to make `make test`
pass cleanly:
* disable broken postmortem debugging in common.gypi
* drop obsolete strict mode test in parallel/test-repl
* drop obsolete test parallel/test-v8-features
PR-URL: https://github.com/iojs/io.js/pull/1232
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Chrome still runs on Windows XP, so there is no reason that iojs
couldn't.
PR: https://github.com/iojs/io.js/pull/512
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
Tell the stl that exception handling is unavailable. This avoids warnings
like:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\
xlocale(337): warning C4530: C++ exception handler used, but unwind
semantics are not enabled. Specify /EHsc
PR-URL: https://github.com/iojs/io.js/pull/258
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Previously exception handling was disabled in release builds, but
enabled in debug builds. That makes no sense.
PR-URL: https://github.com/iojs/io.js/pull/258
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* Define and disable new flag `v8_use_external_startup_data`.
* Disable v8_postmortem_support, it's broken again. Fedor (@indutny)
has volunteered to fix it up in the near future.
PR-URL: https://github.com/iojs/io.js/pull/243
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
The GCC version is no longer relevant since only 4.8 and newer are
supported. It's probably safe to assume clang on mac since V8 does
so too.
PR-URL: https://github.com/iojs/io.js/pull/205
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Now that V8 requires a compiler with decent C++11 support, there is no
reason to keep supporting old versions of gcc. Remove workarounds for
bugs in gcc 4.4 and older.
This coincidentally makes it easier to build with clang 3.3 + address
sanitizer because clang no longer chokes on the `-fno-tree-vrp` switch.
PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Make it possible to build node against Address Sanitizer. Enable with:
$ make -f Makefile.build asan=clang++ CC=clang CC_host=clang
PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Make `make -f Makefile.build ia32.release x64.debug` work. It's not
perfect yet: it requires running `./configure` first and the generated
`config.gypi` is shared across builds.
PR-URL: https://github.com/node-forward/node/pull/24
Reviewed-By: Fedor Indutny <fedor@indutny.com>