This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 153888 - Hardcoded -mno-cygwin in linker
Summary: Hardcoded -mno-cygwin in linker
Status: RESOLVED INVALID
Alias: None
Product: cnd
Classification: Unclassified
Component: Toolchain (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
: 163074 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-25 19:52 UTC by vanag
Modified: 2015-03-31 09:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vanag 2008-11-25 19:52:19 UTC
Hi again, this type I will enter a defect issue. It has to do with Cygwin. My previous enhancement request also holds
for cygwin besides mingw-msys (eclipse does well in this respect). Now about the defect..

Cygwin linking uses by default flag -mno-cygwin. Moreover when I try to put directories for the linker /usr/lib can be
set but the physical folder (in my case c:\winoss\cygwin\lib) cannot be selected but it is defaulted to (in my case
c:\winoss\cygwin\libexec) . I suspect the implementor has hardcoded folders containing -mno-cyging .a files, but it is
just a guess. 

This makes cygwin an unsupported platform. Eclipse has no such problem. I beleieve the resolution is much simpler than
what it is implemented right now.
Comment 1 Thomas Preisler 2009-04-16 00:21:49 UTC
I'm having difficulty understanding what the bugs is. Can you be a bit more specific: what does CND do now and what do
you think it should do instead? Do you have a testcase, or can you provide step-by-step instructions for how to reproduce?
Comment 2 soldatov 2009-04-16 07:39:54 UTC
I want to reminder -mno-cygwin options is deprecated in Cygwin's GCC4
(http://www.cygwin.com/ml/cygwin/2009-03/msg00766.html)
Comment 3 Thomas Preisler 2009-04-16 22:59:11 UTC
soldatov, do you understand what the problem is?
Comment 4 soldatov 2009-04-17 07:59:50 UTC
No
Comment 5 Alexander Simon 2009-04-18 08:16:45 UTC
Cygwin.xml compiler collection has the flag for dynamic library:
    <linker>
        <library_prefix stringvalue="cyg"/>
        <dynamic_library_basic flags="-mno-cygwin -shared "/>
    </linker>
Comment 6 Thomas Preisler 2009-04-20 01:55:54 UTC
Is it wrong to use even it is deprecated? Shouldn't we use -mno-cygwin at all? For some versions or all versions? And
should it be replaced with something else?

Please, state what the issue is!
Comment 7 soldatov 2009-04-20 08:19:13 UTC
I created new issue for my problem (issue 163074)
Comment 8 Thomas Preisler 2009-04-23 21:17:12 UTC
*** Issue 163074 has been marked as a duplicate of this issue. ***
Comment 9 Alexander Simon 2009-05-07 15:28:57 UTC
New toolcain Cygwin_4.x was added in change set:
http://hg.netbeans.org/cnd-main/rev/e16c65922b95
Comment 10 Quality Engineering 2009-05-08 07:46:49 UTC
Integrated into 'main-golden', will be available in build *200905080201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e16c65922b95
User: Andrew Krasny <akrasny@netbeans.org>
Log: IZ#153888 Hardcoded -mno-cygwin in linker (introduce cygwin compiler set for gcc 4.x)
Comment 11 Alexander Simon 2009-05-08 07:56:02 UTC
fixed
Comment 12 Quality Engineering 2009-05-10 07:50:49 UTC
Integrated into 'main-golden', will be available in build *200905100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/88007e73066b
User: alexvsimon@netbeans.org
Log: fixing IZ#153888 Hardcoded -mno-cygwin in linker
- do not detect cygwin compiler set for gcc 4.x if gcc have version 3.x
Comment 13 Thomas Preisler 2009-05-11 19:10:00 UTC
Hi vanag,

can you please test this fix for us? We create a new Cygwin version 4 tool chain that doesn't produce the -mno-cygwin
linker flag and it should fix the problem.
Comment 14 jarome 2010-06-01 15:32:32 UTC
In 6.9 RC1 (win7 64-bit) this has raised its head again. In my C project using MinGW tools, this flag is hard-coded, and I cannot make my DLL.
AND i CANNOT FIND A PLACE TO ELIMINATE THE FLAG.


mkdir -p dist/Debug_MinGW/Cygwin-Windows
gcc.exe     -mno-cygwin -shared -o dist/Debug_MinGW/Cygwin-Windows/_ext/1360937237/logplt.o build/Debug_MinGW/Cygwin-Windows/_ext/1360937237/tkfPush.o build/Debug_MinGW/Cygwin-Windows/_ext/1360937237/pclp.o build/Debug_MinGW/Cygwin-Windows/_ext/1360937237/conmatr.o  
make[2]: Leaving directory `/cygdrive/c/Users/jar/GraphiC2/GraphiC2dll'
make[1]: Leaving directory `/cygdrive/c/Users/jar/GraphiC2/GraphiC2dll'
gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.

make[2]: *** [dist/Debug_MinGW/Cygwin-Windows/libGraphiC2dll.dll] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 35s)


And I have set MinGW as my default, and picked it in my project configuration manager, but the build says Cygwin-Windows
Comment 15 soldatov 2010-06-01 15:52:30 UTC
From previous comment:
We create a new Cygwin version 4 tool
chain that doesn't produce the -mno-cygwin

Cygwin - GCC3 (with -mno-cygwin)
Cygwin_4.X - GCC4 (without -mno-cygwin)
Comment 16 Alexander Pepin 2010-10-27 14:13:14 UTC
It's still an issue with automatic recognition of Cygwin4.x but it's not a P3 any more.
Comment 17 Alexander Simon 2015-03-31 09:52:52 UTC
supporting of Cygwin 3.x was removed.