This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/32815] crtstuff.c,warning, will always evaluate as 'true'
- From: "danglin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Oct 2007 01:41:42 -0000
- Subject: [Bug bootstrap/32815] crtstuff.c,warning, will always evaluate as 'true'
- References: <bug-32815-14862@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from danglin at gcc dot gnu dot org 2007-10-29 01:41 -------
The warnings are expected. From pa64-hpux.h:
/* We don't want undefined weak references to __register_frame_info,
__deregister_frame_info, _Jv_RegisterClasses and __cxa_finalize
introduced by crtbegin.o. The GNU linker only resolves weak
references if they appear in a shared library. Thus, it would be
impossible to create a static executable if the symbols were weak.
So, the best solution seems to be to make the symbols strong and
provide an archive library of empty stub functions. */
#define TARGET_ATTRIBUTE_WEAK
The other part of the story that is missing from the above is that
the HP dynamic linker doesn't support undefined weak symbols. So,
the symbols are strong and there default implementations in a stub
archive library. That's the origin of the warnings.
The warning could be avoided with a hppa64 specific implementation
of crtstuff.c, but the code wouldn't do anything different than it
does now. The if's that cause the warnings are optimized away.
gcc-3.4.6 doesn't have the TARGET_ATTRIBUTE_WEAK define. That's
the relevant difference.
--
danglin at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |danglin at gcc dot gnu dot
| |org
Severity|normal |enhancement
Priority|P3 |P5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32815