public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* don't want leading underscore
@ 2002-11-04 10:36 Benjamin K.
  2002-11-04 11:15 ` Randall R Schulz
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin K. @ 2002-11-04 10:36 UTC (permalink / raw)
  To: cygwin

How can I prevent cygwin gcc from producing symbols with leading underscores? ("_main" instead "main")
I want to be binary compatible with linux and other operating systems.
What about libgcc.a? Each symbol conatins leading underscores, can I change this?
cygwin.dll defines both exports, with and without leading underscores isn't it?

Benjamin Kalytta

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: don't want leading underscore
  2002-11-04 10:36 don't want leading underscore Benjamin K.
@ 2002-11-04 11:15 ` Randall R Schulz
  2002-11-05  8:01   ` Benjamin K.
  0 siblings, 1 reply; 5+ messages in thread
From: Randall R Schulz @ 2002-11-04 11:15 UTC (permalink / raw)
  To: cygwin

Benjamin,

At 10:36 2002-11-04, you wrote:
>How can I prevent cygwin gcc from producing symbols with leading 
>underscores? ("_main" instead "main")
>
>I want to be binary compatible with linux and other operating systems.

Binary compatible? That really has little meaning since there's far more to 
binary compatibility than how symbols from the program source code are or 
are not adorned when emitted into the object code files.


>What about libgcc.a? Each symbol conatins leading underscores, can I 
>change this?
>cygwin.dll defines both exports, with and without leading underscores 
>isn't it?


Apparently it can be changed. If GCC under Linux doesn't prepend the 
underscore and under Cygwin it does, then it's at some level configurable. 
Get the GCC book ("Using and Porting GNUCC").


This excerpt from the output of "gcc -dumpspecs" suggests leading 
underscores is a configurable option (though I don't know why both 
"leading-underscore" and "no-leading-underscore" are listed:

-==-
*cpp_options:
%(cpp_unique_options) %{std*} %{d*} %{W*} %{w} %{pedantic*} %{fshow-column} 
%{fno-show-column} %{fsigned-char&funsigned-char} %{fleading-underscore} 
%{fno-leading-underscore} %{fno-operator-names} %{ftabstop=*}
-==-

So you can use:

   -fleading-underscore    External symbols have a leading underscore


Here's some mildly interesting output:

% gcc -v --help 2>&1 |egrep -i '(leading)|(underscore)'
   -fleading-underscore    External symbols have a leading underscore
   -fno-underscoring       Disable the appending of underscores to externals
   -fno-second-underscore  Never append a second underscore to externals


Anyway, there's a lot to GCC. Read up on it and you'll probably find out 
about other things you'll need to know to get your binary compatibility.


>Benjamin Kalytta


Randall Schulz
Mountain View, CA USA


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: don't want leading underscore
  2002-11-04 11:15 ` Randall R Schulz
@ 2002-11-05  8:01   ` Benjamin K.
  2002-11-05  8:10     ` Randall R Schulz
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin K. @ 2002-11-05  8:01 UTC (permalink / raw)
  To: Randall R Schulz, cygwin

> >I want to be binary compatible with linux and other operating systems.
> 
> Binary compatible? That really has little meaning since there's far more to 
> binary compatibility than how symbols from the program source code are or 
> are not adorned when emitted into the object code files.

Of course, but that is one of the incompatibility.
 
> Apparently it can be changed. If GCC under Linux doesn't prepend the 
> underscore and under Cygwin it does, then it's at some level configurable. 
> Get the GCC book ("Using and Porting GNUCC").


Yes one would think so.
 
> This excerpt from the output of "gcc -dumpspecs" suggests leading 
> underscores is a configurable option (though I don't know why both 
> "leading-underscore" and "no-leading-underscore" are listed:

The problem is that this command line options didn't work.
Of course the only thing that I have to do is to change the compiler source.
I've done this already, but this is not the solution. (just changing bsd.h a bit)
Than I've the problem getting symbols with underscores. (there should be an
working option)
This is just a bad implementation ... or should I say BUG in Gcc.

Benjamin Kalytta


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: don't want leading underscore
  2002-11-05  8:01   ` Benjamin K.
@ 2002-11-05  8:10     ` Randall R Schulz
       [not found]       ` <005301c284e6$df936ac0$0300a8c0@axp>
  0 siblings, 1 reply; 5+ messages in thread
From: Randall R Schulz @ 2002-11-05  8:10 UTC (permalink / raw)
  To: cygwin

Benjamin,

Where else have you sought solutions to your problems? Have you consulted 
the GCC book? Have you asked your questions in one of the GCC-specific 
forums? If not, look here: <http://gcc.gnu.org/lists.html>.

Randall Schulz
Mountain View, CA USA


At 08:01 2002-11-05, Benjamin K. wrote:
> > >I want to be binary compatible with linux and other operating systems.
> >
> > Binary compatible? That really has little meaning since there's far 
> more to
> > binary compatibility than how symbols from the program source code are or
> > are not adorned when emitted into the object code files.
>
>Of course, but that is one of the incompatibility.
>
> > Apparently it can be changed. If GCC under Linux doesn't prepend the
> > underscore and under Cygwin it does, then it's at some level configurable.
> > Get the GCC book ("Using and Porting GNUCC").
>
>
>Yes one would think so.
>
> > This excerpt from the output of "gcc -dumpspecs" suggests leading
> > underscores is a configurable option (though I don't know why both
> > "leading-underscore" and "no-leading-underscore" are listed:
>
>The problem is that this command line options didn't work. Of course the 
>only thing that I have to do is to change the compiler source. I've done 
>this already, but this is not the solution. (just changing bsd.h a bit) 
>Than I've the problem getting symbols with underscores. (there should be 
>an working option) This is just a bad implementation ... or should I say 
>BUG in Gcc.

That is a rash and probably unwarranted condemnation.


>Benjamin Kalytta


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: don't want leading underscore
       [not found]       ` <005301c284e6$df936ac0$0300a8c0@axp>
@ 2002-11-05  8:35         ` Randall R Schulz
  0 siblings, 0 replies; 5+ messages in thread
From: Randall R Schulz @ 2002-11-05  8:35 UTC (permalink / raw)
  To: cygwin

Benjamin,

At 08:17 2002-11-05, Benjamin K. wrote:
>>Have you consulted  the GCC book?
>
>What is the GCC Book? Do you mean GCC documentation. If yes, let me say I 
>read
>everything from top to down.

No. I mean the book whose title I mentioned in my first reply to your 
original query: "Using and Porting GNU CC" by Richard M. Stallman (the 
2.8.1 edition is on-line at <http://www.delorie.com/gnu/docs/gcc/>). It is 
meant as a comprehensive reference to GCC internals, though obviously one 
that falls out of date as soon as it goes into publication. The paper form 
of the version 2.8 edition is 545 pages long.

No doubt a 3.x version would be bigger, if there was a direct counterpart, 
but I don't see any indication there is. (For one thing, it was a pricey 
book: list $50 US). The current equivalent appears to be available here: 
<http://www.gnu.org/software/gcc/onlinedocs/>.


> > Have you asked your questions in one of the GCC-specific
> > forums? If not, look here: <http://gcc.gnu.org/lists.html>.
>
>No not yet because it is nearly impossible to get an answer or that a bug 
>will be fixed.
>I've subscribed 2 of this mailing lists.

You assume this is a bug.

If you haven't asked, how do you know you won't get a useful answer?


> > > This is just a bad implementation ... or should I say
> > >BUG in Gcc.
> >
> > That is a rash and probably unwarranted condemnation.
>
>Ok, maybe :)
>
>Benjamin Kalytta


There's nothing more I can tell you.

Randall Schulz
Mountain View, CA USA


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-11-05 16:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-04 10:36 don't want leading underscore Benjamin K.
2002-11-04 11:15 ` Randall R Schulz
2002-11-05  8:01   ` Benjamin K.
2002-11-05  8:10     ` Randall R Schulz
     [not found]       ` <005301c284e6$df936ac0$0300a8c0@axp>
2002-11-05  8:35         ` Randall R Schulz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).