[SERVER-31439] scons cannot find custom compiler and linker Created: 06/Oct/17 Updated: 27/Oct/23 Resolved: 09/Oct/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Chan Lewis | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
I work on centos 6.8. gcc 5.3 and binutilus is not installed in the standard path. When I use scons, it show: And If I add CC and CXX option to scons, it will find the gcc/g++, but still cannot find corrresonding custom as and ld (system as and ld cannot work). Please help, how can add custom linker to scons ? |
| Comments |
| Comment by Andrew Morrow (Inactive) [ 09/Oct/17 ] | |
|
I'm going to close out this ticket because I don't believe there is additional work indicated for us to do. If you continue to have problems, please feel free to reach out on the mongodb-user or mongodb-dev groups, which I monitor. Or, if you prefer to stay in JIRA, just comment on this ticket and I will see your reply. | |
| Comment by Chan Lewis [ 08/Oct/17 ] | |
|
Thanks. I'll dig into that. | |
| Comment by Andrew Morrow (Inactive) [ 07/Oct/17 ] | |
|
A correctly configured toolchain should know where to look for the linker it was told to build against at configure time. You shouldn't need to set the path. However, you might find the following incantation useful:
This will propagate your shell environment including PATH into all processes spawned by SCons. However, I do suggest that you look into why your toolchain seems to be misbehaving. | |
| Comment by Chan Lewis [ 07/Oct/17 ] | |
|
I suspect it has something to do with this why-doesnt-scons-find-my-compilerlinkeretc-i-can-execute-it-just-fine-from-the-command-line. But SConstrut in the root directory is a little complicated to me, I still don't know where to add statement to support external PATH. | |
| Comment by Chan Lewis [ 07/Oct/17 ] | |
|
Here's the result: /data/software/gcc-5.3.0/bin/g++ -o build/scons/opt/sconf_temp/conftest_2 build/scons/opt/sconf_temp/conftest_2.o Obviously after I add the binutilus/bin to PATH, it'll build ok. So the problem seems that scons doesn't use my ld even though binutilus/bin is in the PATH. | |
| Comment by Andrew Morrow (Inactive) [ 06/Oct/17 ] | |
|
Are you sure your toolchain in /data/software was configured correctly? What does
Print? | |
| Comment by Chan Lewis [ 06/Oct/17 ] | |
|
part of config.log is : /data/software/gcc-5.3.0/bin/g++ -o build/scons/opt/sconf_temp/conftest_2 build/scons/opt/sconf_temp/conftest_2.o Obvisouly it still use the system ld | |
| Comment by Chan Lewis [ 06/Oct/17 ] | |
|
I try to add this to SConstruct, but it seems not be working. env = Environment(ENV = {'PATH' : os.environ['PATH']}) |