Bug 48825 - libiberty "psignal" lacks const modifier, failing to compile when HAVE_PSIGNAL is undefined
Summary: libiberty "psignal" lacks const modifier, failing to compile when HAVE_PSIGNA...
Status: RESOLVED DUPLICATE of bug 47733
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-29 16:26 UTC by Josef Mutzenbacher
Modified: 2011-12-15 01:42 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-04-29 16:42:04


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josef Mutzenbacher 2011-04-29 16:26:00 UTC
../../../libiberty/strsignal.c:554:1: error: conflicting types for ‘psignal’
/usr/include/signal.h:150:13: note: previous declaration of ‘psignal’ was here


strsignal.c:

#ifndef HAVE_PSIGNAL
void 
psignal (int signo, char *message)


/usr/include/signal.h (GLIBC)

extern void psignal (int __sig, __const char *__s);


adding the __const modifier to the prototype of psignal in strsignal.c fixes compilation.
Comment 1 Andrew Pinski 2011-04-29 16:42:04 UTC
HAVE_PSIGNAL is supposed to be defined if the header file has psignal.  Why does that not happen?  Look at config.log.
Comment 2 Josef Mutzenbacher 2011-04-29 16:51:06 UTC
(In reply to comment #1)
> HAVE_PSIGNAL is supposed to be defined if the header file has psignal.  Why
> does that not happen?  Look at config.log.

i was building with musl libc, but not in a chroot.
the first stage uses a wrapper script as CC, which sets the right include paths.
i was using --disable-bootstrap to disable bootstrapping, but make still invoked the compiled xgcc (thus, it looks as it had been entering the bootstrap phase, but without the correct include paths).
Comment 3 froydnj@codesourcery.com 2011-04-29 17:02:42 UTC
On Fri, Apr 29, 2011 at 04:54:34PM +0000, wkor97gy0eef1fr at i dot mintemail.com wrote:
> i was using --disable-bootstrap to disable bootstrapping, but make still
> invoked the compiled xgcc (thus, it looks as it had been entering the bootstrap
> phase, but without the correct include paths).

xgcc is invoked for target libraries; libiberty is built as a target
library.
Comment 4 Josef Mutzenbacher 2011-04-30 12:33:36 UTC
(In reply to comment #3)
> xgcc is invoked for target libraries; libiberty is built as a target
> library.

may i ask why this is being built ? it seems as if it is not needed.
is there a way to disable it ?
Comment 5 Andrew Pinski 2011-06-02 19:30:40 UTC
So the end result of the discussion on the mailing list was that libiberty should not be built as a target library.
Comment 6 Hans-Peter Nilsson 2011-06-08 11:48:36 UTC
It Would Be Nice if the eventual solution could be backported to open gcc branches.

(My autotester, when trying to pick up newlib updates, fails for all branches so it seems anyone trying to build a toolchain with a recent newlib and *any* gcc will be hit.)
Comment 7 Hans-Peter Nilsson 2011-06-22 21:30:25 UTC
Author: hp
Date: Wed Jun 22 21:30:19 2011
New Revision: 175316

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175316
Log:
	PR regression/47836
	PR bootstrap/23656
	PR other/47733
	PR bootstrap/49247
	PR c/48825
	* configure.ac (target_libraries): Remove target-libiberty.
	Remove case-statement setting skipdirs=target-libiberty for
	multiple targets.  Remove checking target_configdirs and
	removing target-libiberty but keeping target-libgcc if
	otherwise empty.
	* Makefile.def (target_modules): Don't add libiberty.
	(dependencies): Remove all traces of target-libiberty.
	* configure, Makefile.in: Regenerate.
(add missing PR annotation in the ChangeLog entry)

Modified:
    trunk/ChangeLog
Comment 8 Hans-Peter Nilsson 2011-06-27 20:55:04 UTC
Author: hp
Date: Mon Jun 27 20:54:59 2011
New Revision: 175560

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175560
Log:
	PR regression/47836
	PR bootstrap/23656
	PR other/47733
	PR bootstrap/49247
	PR c/48825
	* configure.ac (target_libraries): Remove target-libiberty.
	Remove all target-specific settings adding target-libiberty to
	skipdirs and noconfigdirs.  Remove checking target_configdirs
	and removing target-libiberty but keeping target-libgcc if
	otherwise empty.
	* Makefile.def (target_modules): Don't add libiberty.
	(dependencies): Remove all traces of target-libiberty.
	* configure, Makefile.in: Regenerate.

Modified:
    branches/gcc-4_6-branch/ChangeLog
    branches/gcc-4_6-branch/Makefile.def
    branches/gcc-4_6-branch/Makefile.in
    branches/gcc-4_6-branch/configure
    branches/gcc-4_6-branch/configure.ac
Comment 9 Hans-Peter Nilsson 2011-06-27 21:03:01 UTC
Author: hp
Date: Mon Jun 27 21:02:53 2011
New Revision: 175564

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175564
Log:
	PR regression/47836
	PR bootstrap/23656
	PR other/47733
	PR bootstrap/49247
	PR c/48825
	* configure.ac (target_libraries): Remove target-libiberty.
	Remove all target-specific settings adding target-libiberty to
	skipdirs and noconfigdirs.  Remove checking target_configdirs
	and removing target-libiberty but keeping target-libgcc if
	otherwise empty.
	* Makefile.def (target_modules): Don't add libiberty.
	(dependencies): Remove all traces of target-libiberty.
	* configure, Makefile.in: Regenerate.

Modified:
    branches/gcc-4_5-branch/ChangeLog
    branches/gcc-4_5-branch/Makefile.def
    branches/gcc-4_5-branch/Makefile.in
    branches/gcc-4_5-branch/configure
    branches/gcc-4_5-branch/configure.ac
Comment 10 Roger Meyer 2011-10-07 03:06:58 UTC
duplicate of 47733, 41916

additionally to the removal of libiberty as target library, i'd recommend fixing the prototype.
Comment 11 Roger Meyer 2011-10-07 03:21:12 UTC
the actual problem leading to this is that the check for psignal doesn't include the proper feature-test macros

to cite the manpage


SYNOPSIS
       #include <signal.h>

       void psignal(int sig, const char *s);
       void psiginfo(const siginfo_t *pinfo, const char *s);

       extern const char *const sys_siglist[];

   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

       psignal(): _SVID_SOURCE || _BSD_SOURCE
       psiginfo(): _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L
       sys_siglist: _BSD_SOURCE
Comment 12 Andrew Pinski 2011-12-15 01:42:43 UTC
Dup of bug 47733

*** This bug has been marked as a duplicate of bug 47733 ***