NetBSD Problem Report #44450

From www@NetBSD.org  Mon Jan 24 08:26:38 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 37CE663B8BA
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 24 Jan 2011 08:26:38 +0000 (UTC)
Message-Id: <20110124082636.7CBE563B883@www.NetBSD.org>
Date: Mon, 24 Jan 2011 08:26:36 +0000 (UTC)
From: jxraynor@gmail.com
Reply-To: jxraynor@gmail.com
To: gnats-bugs@NetBSD.org
Subject: devel/binutils from pkgsrc-2010Q4 has build/install problem on aix 5.3
X-Send-Pr-Version: www-1.0

>Number:         44450
>Category:       pkg
>Synopsis:       devel/binutils from pkgsrc-2010Q4 has build/install problem on aix 5.3
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    aix-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 24 08:30:01 +0000 2011
>Closed-Date:    Fri May 12 21:53:10 +0000 2023
>Last-Modified:  Fri May 12 21:53:10 +0000 2023
>Originator:     J Raynor
>Release:        aix 5.3
>Organization:
>Environment:
AIX testsys 3 5
>Description:
devel/binutils from pkgsrc-2010Q4 fails to build on aix 5.3 with gcc 4.4.4.  Once I get it to build, there are install errors.  

The build errors are all of the same "missing sentinel" type.  Here's an example:

gcc -DHAVE_CONFIG_H -I. -I.././binutils -I. -D_GNU_SOURCE  -I. -I.././binutils -I../bfd -I.././binutils/../bfd -I.././binutils/../include   -I.././binutils/../intl -I../intl  -DLOCALEDIR="\"/jxr/share/locale\""  -Dbin_dummy_emulation=bin_aix5_emulation   -I/jxr/gcc44/include -I/jxr/gcc44/lib/gcc/powerpc-ibm-aix5.3.0.0/4.4.4/include -I/usr/include -I/jxr/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O -I/jxr/gcc44/include -I/jxr/gcc44/lib/gcc/powerpc-ibm-aix5.3.0.0/4.4.4/include -I/usr/include -I/jxr/include -c -DAIX_WEAK_SUPPORT .././binutils/objdump.c
cc1: warnings being treated as errors
.././binutils/objdump.c: In function 'main':
.././binutils/objdump.c:2990: error: missing sentinel in function call
*** Error code 1

Stop.
bmake: stopped in /jxr/pkgsrc/devel/binutils/work/binutils-2.17/binutils
*** Error code 1




Once I fix the build errors, I get the following errors when I install:

=> Running POST-INSTALL script actions
pkg_create: can't stat `/jxr/bin/gnu-gprof'
pkg_create: can't stat `/jxr/info/gprof.info'
pkg_create: can't stat `/jxr/man/man1/gnu-gprof.1'
pkg_create: can't stat `/jxr/share/locale/da/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/de/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/es/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/fr/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/ga/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/id/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/pt_BR/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/rw/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/sv/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/tr/LC_MESSAGES/gprof.mo'
pkg_create: can't stat `/jxr/share/locale/vi/LC_MESSAGES/gprof.mo'
=> Registering installation for binutils-2.17nb1
pkg_admin: binutils-2.17nb1: File `/jxr/bin/gnu-gprof' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/info/gprof.info' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/man/man1/gnu-gprof.1' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/da/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/de/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/es/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/fr/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/ga/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/id/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/pt_BR/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/rw/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/sv/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/tr/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
pkg_admin: binutils-2.17nb1: File `/jxr/share/locale/vi/LC_MESSAGES/gprof.mo' is in +CONTENTS but not on filesystem!
binutils-2.17nb1 requires installed package pkg_install-info-4.5nb3




>How-To-Repeat:
Build devel/binutils from pkgsrc-2010Q4 with gcc 4.4.4 on aix 5.3.
>Fix:
The "missing sentinal" error occurs in calls to concat that are terminated with NULL.  Here's an example:

p->local_sym_name = concat ("-l", name, NULL);


This might only be a problem with newer versions of gcc.  At any rate, the source files end concat calls in different ways besides just NULL, and one other way is with "(const char * ) 0".  Below are patches that change the problem concat calls.  Newer versions of binutils have already eliminated NULL terminated concat calls, so there's no need for me to send patches upstream.  Also, gas/read.c already had a patched applied to it in patch-af.  My patch incorporates that patch.



--- binutils/objdump.c.orig     2011-01-24 01:24:35.000000000 -0600
+++ binutils/objdump.c  2011-01-24 01:25:14.000000000 -0600
@@ -2987,7 +2987,7 @@
          if (disassembler_options)
            /* Ignore potential memory leak for now.  */
            disassembler_options = concat (disassembler_options, ",",
-                                          optarg, NULL);
+                                          optarg, (const char *) 0);
          else
            disassembler_options = optarg;
          break;





--- gas/read.c.orig     2005-11-17 01:29:28.000000000 -0600
+++ gas/read.c  2011-01-24 01:29:59.000000000 -0600
@@ -1423,7 +1423,7 @@
   offsetT temp, size;
   symbolS *symbolP = NULL;
   char *stop = NULL;
-  char stopc;
+  char stopc = '\0'; /* XXX: gcc -Wuninitialized */
   expressionS exp;

   if (flag_mri)
@@ -3251,14 +3251,14 @@
          char *loop;

          loop = concat (S_GET_NAME (symbolP),
-                        " => ", S_GET_NAME (symbolP2), NULL);
+                        " => ", S_GET_NAME (symbolP2), (const char * ) 0);

          symp = symbolP2;
          while (symp != symbolP)
            {
              char *old_loop = loop;
              symp = symbol_get_value_expression (symp)->X_add_symbol;
-             loop = concat (loop, " => ", S_GET_NAME (symp), NULL);
+             loop = concat (loop, " => ", S_GET_NAME (symp), (const char * ) 0);
              free (old_loop);
            }






--- ld/ldfile.c.orig    2011-01-24 01:37:38.000000000 -0600
+++ ld/ldfile.c 2011-01-24 01:38:37.000000000 -0600
@@ -115,7 +115,7 @@
      now.  */
   if (name[0] == '=')
     {
-      new->name = concat (ld_sysroot, name + 1, NULL);
+      new->name = concat (ld_sysroot, name + 1, (const char * ) 0);
       new->sysrooted = TRUE;
     }
   else





--- ld/ldlang.c.orig    2011-01-24 01:34:41.000000000 -0600
+++ ld/ldlang.c 2011-01-24 01:36:58.000000000 -0600
@@ -813,7 +813,7 @@
       p->is_archive = TRUE;
       p->filename = name;
       p->real = TRUE;
-      p->local_sym_name = concat ("-l", name, NULL);
+      p->local_sym_name = concat ("-l", name, (const char * ) 0);
       p->just_syms_flag = FALSE;
       p->search_dirs_flag = TRUE;
       break;




As for the install problem, I see this in the configure output:

checking for correct version of gmp.h... no
*** This configuration is not supported in the following subdirectories:
     gprof
    (Any other directories should still work fine.)




Since gprof doesn't get built, I get the install errors listed above.  I don't know if the problem with gmp.h is just on my system, or if this is a problem on aix.  If the problem is on aix and the installation process shouldn't try to install the gprof files, then the following patch to Makefile will prevent the install errors:


--- Makefile.orig       2011-01-24 01:05:14.000000000 -0600
+++ Makefile    2011-01-24 01:07:32.000000000 -0600
@@ -39,7 +39,7 @@
 #
 PLIST_VARS+=   gprof
 .include "../../mk/bsd.prefs.mk"
-.if ${OPSYS} != "IRIX"
+.if ${OPSYS} != "IRIX" && ${OPSYS} != "AIX"
 PLIST.gprof=   yes
 .endif






>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->aix-pkg-people
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Thu, 26 Apr 2012 13:43:23 +0000
Responsible-Changed-Why:
problem on AIX.


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44450 CVS commit: pkgsrc/devel/binutils
Date: Sun, 28 May 2017 02:28:24 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Sun May 28 02:28:24 UTC 2017

 Modified Files:
 	pkgsrc/devel/binutils: Makefile

 Log Message:
 binutils: don't include PLIST.gprof on AIX
 gprof requires some OS support to work.

 part of PR pkg/44450: devel/binutils from pkgsrc-2010Q4 has
 build/install problem on aix 5.3 from J. Raynor


 To generate a diff of this commit:
 cvs rdiff -u -r1.74 -r1.75 pkgsrc/devel/binutils/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 12 May 2023 21:53:10 +0000
State-Changed-Why:
There were two problems in here; the fix for one got committed in 2017
and the other one was already "fixed in newer versions of binutils" in
2010 so is no longer relevant.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.