Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353890 - C/C++ GCC Cross Compiler support for dynamic libraries is broken
Summary: C/C++ GCC Cross Compiler support for dynamic libraries is broken
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 major with 1 vote (vote)
Target Milestone: 8.0.2   Edit
Assignee: Marc-André Laperle CLA
QA Contact: Chris Recoskie CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 353719
  Show dependency tree
 
Reported: 2011-08-04 10:09 EDT by AK CLA
Modified: 2012-04-28 15:28 EDT (History)
4 users (show)

See Also:


Attachments
Use a custom page for Cross GCC toolchain (41.07 KB, patch)
2012-01-18 22:15 EST, Marc-André Laperle CLA
malaperle: iplog-
Details | Diff
Reuse cross-compile template for shared, static library (1.93 KB, patch)
2012-01-28 14:02 EST, Marc-André Laperle CLA
malaperle: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description AK CLA 2011-08-04 10:09:25 EDT
Build Identifier: 20110615-0604

Fix for Bug 344009 is incomplete. I followed Bug 353719 Comment 6 to try building a dynamic library. After doing so I still have the wrong includes.

Reproducible: Always

Steps to Reproduce:
1. Generate a new C++ project --> Shared Library --> CrossGCC
2. Bug 1: you are __not__ asked for compiler prefix and path to cross tool chain
3. Generate a cpp and h file containing only one simple function to do a printf("%S:%d\n", __FILE__, __LINE__)
4. Project settings --> C/C++ Build --> Discovery Options --> press "clear" for all Tools and configurations
5. press ok
6. Project settings --> C/C++ Build --> Settings --> set compiler prefix and path to cross tool chain
7. press ok
8. run build and indexer
9. go to Project settings --> C/C++ General --> PAths and Symbols --> Includes
10. Bug 2: the local plattform include paths are shown instead of plattform target includes paths
Comment 1 Marc-André Laperle CLA 2011-12-31 15:32:49 EST
Hi Andrew (or Doug?),

The wizard only asks for the compiler prefix and path when the "Cross-Compile Project" is selected. This is because a project template is used. I was thinking of removing the template and using a custom page instead that would be displayed anytime the Cross GCC toolchain is selected. That way, the UI won't be cluttered with additional project templates. Does that seem reasonable? Or is this too much of a departure to remove the project template? Thanks!
Comment 2 Marc-André Laperle CLA 2012-01-18 22:15:32 EST
Created attachment 209717 [details]
Use a custom page for Cross GCC toolchain
Comment 3 Andrew Gvozdev CLA 2012-01-20 14:05:51 EST
(In reply to comment #2)
> Created attachment 209717 [details]
> Use a custom page for Cross GCC toolchain
If you ask me, I like it better that way. Shouldn't the custom page be presented before "Select Configuration"? I would think if you are creating cross-project you'd need that first, especially considering that UI does not remember the settings. If project templates don't support that user flow, too bad for the templates. Maybe we need to think about improving them.
Take it with a grain of salt as I haven't used that toolchain before.
Comment 4 Marc-André Laperle CLA 2012-01-26 12:39:06 EST
(In reply to comment #3)
> If you ask me, I like it better that way. Shouldn't the custom page be
> presented before "Select Configuration"? 

Thanks for the feedback. From what I understand, only pages coming from templates can be displayed before CDTConfigWizardPage ("Select Configuration"), like the Hello world template. Custom pages are always after, like the XLC page and the custom page in this patch. I think it would be great if the custom pages could specify whether or not to be displayed before that page. But we could deal with this enhancement in another bug and fix the XLC page at the same time.

> especially considering that UI does not remember the settings. 

Good catch, the Cross Compile template did remember the settings so I will look into remembering the settings for the custom page too.
Comment 5 Doug Schaefer CLA 2012-01-26 13:05:23 EST
I'm redesigning the new project wizard. I'll make sure the Cross GCC template works as required here.
Comment 6 Marc-André Laperle CLA 2012-01-27 01:51:05 EST
(In reply to comment #5)
> I'm redesigning the new project wizard. I'll make sure the Cross GCC template
> works as required here.

Ok, then maybe I'll drop the idea of removing the template and using a custom page since the wizard is being redesigned anyway. I was doing that to clean up the oddities in the current wizard but might as well go with the more conservative route and leave the big changes for CDT9/wizardageddon.
Comment 7 Marc-André Laperle CLA 2012-01-28 14:02:50 EST
Created attachment 210233 [details]
Reuse cross-compile template for shared, static library

This patch reuses the template for shared library and static library; it's much smaller than the previous patch. Since I would like this to be fixed in 8.0.2, I think this is more suitable because it doesn't do any drastic changes. Then in CDT 9 we can clean that up in the new wizard or if the new wizard doesn't happen, we can go with a custom page and make XLC work in the same fashion.

After applying the patch, Cross-compile Project appears under Shared Library and Static Library.
Comment 8 Doug Schaefer CLA 2012-01-28 14:52:41 EST
Please hold off on this. In the new scheme of things, we can do a better job of dealing with the cross gcc template.
Comment 9 Doug Schaefer CLA 2012-01-28 14:53:55 EST
(In reply to comment #7)
> Created attachment 210233 [details]
> Reuse cross-compile template for shared, static library
> 
> This patch reuses the template for shared library and static library; it's much
> smaller than the previous patch. Since I would like this to be fixed in 8.0.2,
> I think this is more suitable because it doesn't do any drastic changes. Then
> in CDT 9 we can clean that up in the new wizard or if the new wizard doesn't
> happen, we can go with a custom page and make XLC work in the same fashion.
> 
> After applying the patch, Cross-compile Project appears under Shared Library
> and Static Library.

Or at least apply this to 8.0 only.
Comment 10 Marc-André Laperle CLA 2012-01-28 16:12:38 EST
(In reply to comment #9)
> Or at least apply this to 8.0 only.

Ok, patch applied to 8.0.2 only. I'll keep this opened until it's fixed on master.
Comment 11 Marc-André Laperle CLA 2012-04-28 15:28:14 EDT
I applied the patch that uses a custom page to master with a minor change: It nows loads and saves default settings using SharedDefaults (like templates do), this also provides backward compatibility for defaults were already saved with the template.

So with this change, users can select any project type that is compatible with the toolchain (Exec/Empty, Exec/Hello world, Static/Empty, Shared/Empty), select the Cross toolchain and still get the Cross compile page in the wizard. In previous versions, in was possible to select some combinations and not get the page: Exec/Empty project, Static/Empty, Shared/Empty. I also made it so that the Cross compile page needs to be visited. The changes reduce clutter and should make the Cross toolchain less error prone which will hopefully help bug 353719.