build: fix cctest target with --enable-static#17992
build: fix cctest target with --enable-static#17992liqyan wants to merge 1 commit intonodejs:masterfrom liqyan:fix_cctest_build
Conversation
mmarchini
left a comment
There was a problem hiding this comment.
Thanks for working on this and welcome! The changes (adding a check for node_target_type) look fine, but the diff is too big because there's reallocation of some conditions (e.g. moving node_use_dtrace before node_use_openssl), making it harder to review and to look at the git log in the future. Could you try to keep the changes to a minimum, focusing only on what's important to this PR? (unless the reallocations are necessary)
node.gyp
Outdated
There was a problem hiding this comment.
Not sure I understood this comment
Currently the cctest target build will fail if configured with --enable-static $ ./configure --enable-static $ make There're some function multiple definition errors such as: out/Release/obj.target/node/src/node_crypto.o: In function `node::crypto::RandomBytesWork(uv_work_s*)': node_crypto.cc:(.text+0x60): multiple definition of `node::crypto::RandomBytesWork(uv_work_s*)' out/Release/obj.target/node/src/node_crypto.o:node_crypto.cc:(.text+0x60): first defined here It's caused by repetition objects in libraries and libnode.a. This CL makes those libraries guarded by 'node_target_type!="static_library"'.
|
I updated node.gyp to minimize the changes. |
|
The fix looks good for me. However, I am also doing the static/shared lib refine here: #17604 I guess the fix here will be overrode by my change if this change lands first. |
Currently the cctest target build will fail if configured with --enable-static $ ./configure --enable-static $ make There're some function multiple definition errors such as: out/Release/obj.target/node/src/node_crypto.o: In function `node::crypto::RandomBytesWork(uv_work_s*)': node_crypto.cc:(.text+0x60): multiple definition of `node::crypto::RandomBytesWork(uv_work_s*)' out/Release/obj.target/node/src/node_crypto.o:node_crypto.cc:(.text+0x60): first defined here It's caused by repetition objects in libraries and libnode.a. This CL makes those libraries guarded by 'node_target_type!="static_library"'. PR-URL: #17992 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in 23c9597 |
Currently the cctest target build will fail if configured with --enable-static $ ./configure --enable-static $ make There're some function multiple definition errors such as: out/Release/obj.target/node/src/node_crypto.o: In function `node::crypto::RandomBytesWork(uv_work_s*)': node_crypto.cc:(.text+0x60): multiple definition of `node::crypto::RandomBytesWork(uv_work_s*)' out/Release/obj.target/node/src/node_crypto.o:node_crypto.cc:(.text+0x60): first defined here It's caused by repetition objects in libraries and libnode.a. This CL makes those libraries guarded by 'node_target_type!="static_library"'. PR-URL: #17992 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Currently the cctest target build will fail if configured with --enable-static $ ./configure --enable-static $ make There're some function multiple definition errors such as: out/Release/obj.target/node/src/node_crypto.o: In function `node::crypto::RandomBytesWork(uv_work_s*)': node_crypto.cc:(.text+0x60): multiple definition of `node::crypto::RandomBytesWork(uv_work_s*)' out/Release/obj.target/node/src/node_crypto.o:node_crypto.cc:(.text+0x60): first defined here It's caused by repetition objects in libraries and libnode.a. This CL makes those libraries guarded by 'node_target_type!="static_library"'. PR-URL: #17992 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Currently the cctest target build will fail if configured with --enable-static $ ./configure --enable-static $ make There're some function multiple definition errors such as: out/Release/obj.target/node/src/node_crypto.o: In function `node::crypto::RandomBytesWork(uv_work_s*)': node_crypto.cc:(.text+0x60): multiple definition of `node::crypto::RandomBytesWork(uv_work_s*)' out/Release/obj.target/node/src/node_crypto.o:node_crypto.cc:(.text+0x60): first defined here It's caused by repetition objects in libraries and libnode.a. This CL makes those libraries guarded by 'node_target_type!="static_library"'. PR-URL: #17992 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
This lands cleanly on v8.x but requires a manual backport for v6.x |
ref issue: #17991
Currently the cctest target build will fail if configured with --enable-static
$ ./configure --enable-static
$ make
There're some function multiple definition errors such as:
It's caused by repetition objects in libraries and libnode.a.
This CL makes those libraries guarded by 'node_target_type!="static_library"'.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
build