Skip to content

Linker-script processing fixes #1888

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

Merged
merged 6 commits into from
Mar 3, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/goto-cc/gcc_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ int gcc_modet::run_gcc(const compilet &compiler)
for(const auto &a : cmdline.parsed_argv)
new_argv.push_back(a.arg);

if(compiler.wrote_object_files())
if(!act_as_ld && compiler.wrote_object_files())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear to me where this is set / why this would work but in this part of the code I am willing to take your word for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

act_as_ld is a class member set upon construction, with its value dependent on the name of the executable that is running this code ("goto-ld" -> true, "goto-cc" -> false). When acting as a linker, we shouldn't be adding preprocessor command-line options.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK; fair.

{
// Undefine all __CPROVER macros for the system compiler
std::map<irep_idt, std::size_t> arities;
Expand Down