delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/04/23/10:27:34

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <480F4734.7000705@gmail.com>
Date: Wed, 23 Apr 2008 11:27:00 -0300
From: "san DOT temporal AT gmail DOT com" <san DOT temporal AT gmail DOT com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Fwd: gcc does not honor -fno-leading-underscore flag?
References: <89ed9b610804221310p4ba3bdf1gf2cd40030793bd34 AT mail DOT gmail DOT com> <89ed9b610804221319g6e9e6c7cm1077c64cb1f32dda AT mail DOT gmail DOT com> <480E4A57 DOT 2EF8731A AT dessent DOT net>
In-Reply-To: <480E4A57.2EF8731A@dessent.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com


Brian Dessent wrote:
> san DOT temporal AT gmail DOT com wrote:
>
>   
>> I do not know how to get rid of the leading underscores in Cygwin. I
>> have other sources compiled in Linux, and they do not have a leading
>> underscore added.
>>     
>
> As I understand it, the -fleading-underscore flag is only useful to add
> a leading underscore for targets that do not have a leading underscore,
> like linux.  It won't accomplish anything on one that already has it,
> like PE.
>   
You may be right. But then this is strange for me. I would guess that 
either -fleading-underscore or -fno-leading-underscore do something, but 
not both doing nothing. So if a target does have a leading underscore 
and then -fleading-underscore does nothing on it (according to what you 
say), then I would expect -fno-leading-underscore removing the underscore.

>> Now my problem is that I have a library with symbol names without a
>> leading underscore. Although the library is for Linux (I do not have a
>> version specific for Cygwin, which would be the ideal solution, and I
>> do not think that I could get it; I don't have the sources), I expect
>> it to work under Cygwin (or at least give it a try), if only I could
>> get my objects to link with its symbols. Even if I am trying to mix
>> objects for different platforms, I guess that there should be a chance
>> to do it by appropriate configuration. The flag
>> -fno-leading-underscore seemed to be the answer, but it did not work
>> for me.
>>     
>
> There is absolutely no way that you can use an object compiled for Linux
> with Cygwin.  The fact that symbols don't have a leading underscore is
> trivial compared to the massive differences between ELF and PE formats. 
> There is just no chance of this working even if you solved the
> underscore issue.
>   
I suspected this, but I was not sure. I do not know what is ELF and 
PE... I though about trying since I have Windows apps that work on 
Cygwin, but possibly they are much more similar.

Thanks a lot.

Santiago


> Brian
>   

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019