bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch required to m4-1.4.16 lib/verror.h to allow compile with non-GNU c


From: Dennis Clarke
Subject: patch required to m4-1.4.16 lib/verror.h to allow compile with non-GNU compiler
Date: Mon, 15 Jul 2013 21:56:25 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130704 Icedove/17.0.7

The __attribute__ extension may not be supported. Certainly the case with
an older UNIX system like Solaris 8 and a compiler such as Sun ONE Studio 11
which is the last compiler from Sun supported on Solaris 8.

the error that I see :


|/opt/SUNWspro/bin/cc-I.    -D_REENTRANT-I/usr/local/include-dy-xmemalign=8s  
-errfmt=error-erroff=%none-errshort=full-errwarn=%none-fns=no-ftrap=%none-xarch=v9-xcode=pic32-g-i-mc-Qy
  -v-Wl,-R/usr/local/lib-Xa  -xstrconst-xtemp=/var/tmp-xunroll=1  
-D_POSIX_PTHREAD_SEMANTICS-D_LARGEFILE64_SOURCE-D_TS_ERRNO-c verror.c
"verror.h",  line35:  error:  syntax error before or at:  __attribute__
"verror.h",  line35:  warning:  old-style declaration or incorrect typefor:  
__attribute__
"verror.h",  line35:  warning:  syntax error:   empty declaration
"verror.h",  line47:  error:  syntax error before or at:  __attribute__
"verror.h",  line47:  warning:  old-style declaration or incorrect typefor:  
__attribute__
"verror.h",  line47:  error:  identifier redefined:  __attribute__
        current:  function()  returningint
        previous:  function()  returningint  :  "verror.h",  line35
"verror.h",  line47:  warning:  syntax error:   empty declaration
"verror.c",  line44:  error:  identifier redefined:  verror
        current:  function(int,  int,  pointer toconst  char,  pointer tovoid)  
returningvoid
        previous:  function(int,  int,  pointer toconst  char,  pointer tovoid)  
returningvoid  :  "verror.h",  line33
"verror.c",  line57:  error:  identifier redefined:  verror_at_line
        current:  function(int,  int,  pointer toconst  char,  unsigned  int,  
pointer toconst  char,  pointer tovoid)  returningvoid
        previous:  function(int,  int,  pointer toconst  char,  unsigned  int,  pointer 
toconst  char,  pointer tovoid)  returningvoid  :  "verror.h",  line44
cc:  acomp failedfor  verror.c
gmake[3]:  ***  [verror.o]  Error  2
gmake[3]:  Leaving  
directory`/usr/local/build/m4-1.4.16_SunOS5.8_sparcv9.001/lib'
gmake[2]:  ***  [all]  Error  2
gmake[2]:  Leaving  
directory`/usr/local/build/m4-1.4.16_SunOS5.8_sparcv9.001/lib'
gmake[1]:  ***  [all-recursive]  Error  1
gmake[1]:  Leaving  directory`/usr/local/build/m4-1.4.16_SunOS5.8_sparcv9.001'
gmake:  ***  [all]  Error  2

My quick hack, not very elegant patch :

$ diff lib/verror.h.backup lib/verror.h
26a27,38
#ifndef __GNUC__
/* this is not the GNU GCC compiler
 * therefore __attribute__ may not work */
#define __attribute__(x)
#endif

#ifdef __SUNPRO_C
/* this is a Sun or Oracle Studio or Forte compiler
 * and __attribute__ may not work */
#define __attribute__(x)
#endif



This works fine and :

$ gmake check
.
.
.


=======================
All 115 tests passed
(15 tests were not run)
=======================



$ which gm4
/usr/local/bin/gm4
$ gm4 --version
m4 (GNU M4) 1.4.16
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Rene' Seindal.
$
$ file /usr/local/bin/gm4
/usr/local/bin/gm4:     ELF 64-bit MSB executable SPARCV9 Version 1, 
dynamically linked, not stripped
$
$ elfdump -devl /usr/local/bin/gm4

ELF Header
  ei_magic:   { 0x7f, E, L, F }
  ei_class:   ELFCLASS64          ei_data:      ELFDATA2MSB
  e_machine:  EM_SPARCV9          e_version:    EV_CURRENT
  e_type:     ET_EXEC
  e_flags:    [ EF_SPARCV9_TSO ]
  e_entry:           0x100018d60  e_ehsize:     64  e_shstrndx:   30
  e_shoff:              0x1a7680  e_shentsize:  64  e_shnum:      31
  e_phoff:                  0x40  e_phentsize:  56  e_phnum:       5

Version Needed Section:  .SUNW_version
            file                        version
            libc.so.1                   SUNW_1.18
                                        SUNWprivate_1.1

Dynamic Section:  .dynamic
     index  tag               value
       [0]  NEEDED           0xbf9c            libsigsegv.so.2
       [1]  NEEDED           0xbf78            libc.so.1
       [2]  INIT             0x10008a310
       [3]  FINI             0x10008a320
       [4]  RUNPATH          0xbfac            /usr/local/lib
       [5]  RPATH            0xbfac            /usr/local/lib
       [6]  HASH             0x100000178
       [7]  STRTAB           0x10000bf58
       [8]  STRSZ            0xbfbb
       [9]  SYMTAB           0x100003108
      [10]  SYMENT           0x18
      [11]  CHECKSUM         0x7527
      [12]  VERNEED          0x100017f18
      [13]  VERNEEDNUM       0x1
      [14]  PLTRELSZ         0xd80
      [15]  PLTREL           0x7
      [16]  JMPREL           0x100017fd8
      [17]  RELA             0x100017f48
      [18]  RELASZ           0xe10
      [19]  RELAENT          0x18
      [20]  DEBUG            0
      [21]  FEATURE_1        0x1               [ PARINIT ]
      [22]  FLAGS            0                 0
      [23]  FLAGS_1          0                 0
      [24]  PLTGOT           0x100193900
$
$

works fine.

Dennis







|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]