Bug 423789 - copying a build configuration does not reset "shared" flag
Summary: copying a build configuration does not reset "shared" flag
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 8.2.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-11 05:58 EST by Chris Maes CLA
Modified: 2020-09-04 15:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Maes CLA 2013-12-11 05:58:25 EST
I had a build configuration for a shared library; and copied it to a new configuration for an executable. The "shared" flag remained set; causing "Illegal instruction" when running the executable. I already noticed this in Juno, but the bug is still here in Keppler.
Comment 1 Sergey Platov CLA 2016-11-11 04:53:57 EST
The bug is still reproduced in Neon.1a Release (4.6.1), Build id: 20161007-1200, with CDT Version: 9.1.0.201609121658

My Eclipse installation detects both Cygwin and MSVC toolchains, and all of them have the same bug which is reproduced with minor changes.

Here is steps to reproduce it with MSVC toolchain:

1. Select File -> New -> C Project and provide a project name.
2. In "Project type", select "Executable -> Empty project", "Microsoft Visual C++" toolchain and click the "Next" button
3. On the "Select configuration" page, press the "Advanced settings" button and proceed to the "C/C++ Build -> Settings" page.
4. On the "Tool Settings" tab, click the "Linker" node and ensure that only "/debug /nologo" options are present in the "All options" area.
5. Switch to the "Build artifact" tab and change "Artifact type" to "Shared Library"
6. Return to the Linker options and ensure that "/DLL" option is added to the options.
7. Navigate to the "Build artifact" tab again and change back the "Artifact type" value to "Executable"
8. Finally, return to the Linker options. And here is the bug: the "/DLL" option is still present in the "All options" area.

The same steps can be used to reproduce that bug using Cygwin GCC toolchain, replacing "Linker"  by "Cygwin C Linker" and "/DLL" by "-shared" option in 4-8 steps. But there is one significant note: the "Cygwin C Linker" node have "Shared Library Settings" subnode, which have "Shared" checkbox. Removing selection from that checkbox will remove the "-shared" linker option, so it can be considered as workaround, but IMO this action should be taken automatically. Unfortunately, when MSVC toolchain is used, that subnode is not present, so the only way to remove that option is to edit the .cproject file manually.