Bug 163672 - Other Objects on Win
Summary: Other Objects on Win
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 major with 1 vote (vote)
Target Milestone: 4.0.3   Edit
Assignee: Chris Recoskie CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-11-07 10:50 EST by Tiziano Leidi CLA
Modified: 2008-06-22 02:39 EDT (History)
6 users (show)

See Also:


Attachments
proposed patch (1.61 KB, patch)
2008-01-31 17:38 EST, Keith W. Campbell CLA
no flags Details | Diff
proposed patch (1.61 KB, patch)
2008-02-12 11:04 EST, Keith W. Campbell CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tiziano Leidi CLA 2006-11-07 10:50:31 EST
GCC C Linker property - Other Objects

when adding other objects in the following way to project properties:

"${workspace_loc:/path1/path2/path3/B_baseAmplitude_StandardGate.o}"

under Windows it is tranlated in a way gcc seems not to agree:

Building target: inProva1Debug.exe
Invoking: GCC C Linker
gcc  -o"inProva1Debug.exe"  ./csrc/B_ProvainProva1_Application.o ./csrc/B_ProvainProva1_Configuration.o ./csrc/B_ProvainProva1_SoftwareUnit.o ./csrc/B_ProvainProva1_StandardGate.o ./csrc/RProd_ProvainProva1_SoftwareUnit.o ./csrc/R_ProvainProva1_StandardGate.o  ./crunner/CRunner_inProva1_Application.o  E:\Eclipse-Workspaces\DSPE-Workspace\path1\path2\path3\B_baseAmplitude_StandardGate.o -lpthreadGC2
gcc.exe: E:Eclipse-WorkspacesDSPE-Workspacepath1path2path3B_baseAmplitude_StandardGate.o: No such file or directory
make: *** [inProva1Debug.exe] Error 1
make: Target `all' not remade because of errors.
Build complete for project Prova_c
Comment 1 Tiziano Leidi CLA 2006-11-08 05:21:15 EST
Further clarified this Bug:

The same problem is available if other objects are specified with absolute path in the form:

"C:\path1\path2\path3\B_baseAmplitude_StandardGate.o"

Both described ways to specify other objects paths, are used automatically by buttons "Workspace.." and "FileSystem.." in properties editor under Win !

if the absolute path is added instead in the same way as on the Linux Platform:

"C:/path1/path2/path3/B_baseAmplitude_StandardGate.o"

everything work has it should.

There's a further notice to this bug:

if PATH to e.g. a .dll is added with the relative to workspace form
"${workspace_loc:/path1/path2/path3/B_baseAmplitude_StandardGate.o}"
but the .dll does not exists in the specified location, nothing at all is generated in the makefile.
This could be really confusing, I think it is always better to generate the specified path and let GCC tell us about the problem of missing file.
Comment 2 Doug Schaefer CLA 2008-01-09 15:54:57 EST
Which version of gcc are you using? cygwin? mingw?

I think this should work with mingw since it understands Windows paths. New cygwin versions do not.
Comment 3 Keith W. Campbell CLA 2008-01-09 17:15:02 EST
I don't it matters, but we're using g++ 3.4.4. Things fall apart in the (emulated) shell that launches the linker. The backslashes (\) are interpreted by that shell and disappear before the linker is executed.

The macro definition is serving double-duty: it is used in the list of prerequisites of the link rule and it is used on the link command line. These are really two different languages.

Expressing the paths with forward slashes (/) works for make (and would be consistent with the treatment given other paths like those that arise from specifying references to libraries). Using forward slashes also works for (nearly?) every linker I've encountered, but I'm sure there are those that will insist on backslashes.
Comment 4 Tiziano Leidi CLA 2008-01-10 02:22:29 EST
Hi Doug,
the compiler we were using when I reported the Bug were the C compiler from MinGW. We still have a workaround to the problem, please let me know if the behaviuor changes in order that I may remove the workaround and retest the feature. We produce code with a generator and the information is filled automatically.
Best Regards
Tiz
Comment 5 Keith W. Campbell CLA 2008-01-31 17:38:34 EST
Created attachment 88478 [details]
proposed patch

Here's a patch that makes the slashes go forward as I suggested.
Comment 6 Keith W. Campbell CLA 2008-01-31 17:41:39 EST
I should have noted that it would be desirable to
have this in the 4.0.x stream as well as in head.
Comment 7 Chris Recoskie CLA 2008-02-01 13:01:52 EST
I'll take a loook.
Comment 8 Keith W. Campbell CLA 2008-02-12 11:04:09 EST
Created attachment 89510 [details]
proposed patch

Patch updated: must change slashes before call to
ensurePathIsGNUMakeTargetRuleCompatibleSyntax().
Comment 9 Chris Recoskie CLA 2008-02-15 08:58:17 EST
Applied to 4.0.3 and HEAD.  Thanks Keith.