-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: fix cctest target with --enable-static #17992
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
], | ||
}], | ||
], | ||
}], # end node_target_type conditions block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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