List Info

Thread: Another dumb question about Solaris compiles




Another dumb question about Solaris compiles
user name
2007-01-05 14:05:42
I am working at using the Sun-provided GNU tools (gcc, etc)
on Solaris 
10u3 to compile rpm 4.4.8.  I'm running into a little
trouble in rpmio:



/bin/bash ../libtool --tag=CC   --mode=compile gcc
-DHAVE_CONFIG_H -I. 
-I.. -I. -I.. -I/usr/local/rpm-4.4.8/include/beecrypt
-I../popt -I../misc 
-I../zlib -I/usr/local/rpm-4.4.8/include 
-I/usr/local/rpm-4.4.8/include 
-I/usr/local/rpm-4.4.8/include -L/usr/local/rpm-4.4.8/lib
-fPIC -DPIC 
-D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith
-Wstrict-prototypes 
-Wmissing-prototypes -Wno-char-subscripts -MT fts.lo -MD -MP
-MF 
.deps/fts.Tpo -c -o fts.lo fts.c
  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I.. 
-I/usr/local/rpm-4.4.8/include/beecrypt -I../popt -I../misc
-I../zlib 
-I/usr/local/rpm-4.4.8/include
-I/usr/local/rpm-4.4.8/include 
-I/usr/local/rpm-4.4.8/include -L/usr/local/rpm-4.4.8/lib
-fPIC -DPIC 
-D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith
-Wstrict-prototypes 
-Wmissing-prototypes -Wno-char-subscripts -MT fts.lo -MD -MP
-MF 
.deps/fts.Tpo -c fts.c  -fPIC -DPIC -o .libs/fts.o
fts.c: In function `fts_build':
fts.c:819: error: `USHRT_MAX' undeclared (first use in this
function)
fts.c:819: error: (Each undeclared identifier is reported
only once
fts.c:819: error: for each function it appears in.)
fts.c: In function `fts_palloc':
fts.c:1128: error: `USHRT_MAX' undeclared (first use in this
function)
fts.c: In function `fts_safe_changedir':
fts.c:1204: warning: passing arg 2 of `fstat' from
incompatible pointer 
type
gmake: *** [fts.lo] Error 1


After poking around the preprocessor output and the headers,
it looks like 
it is getting sys/types.h from some repository the gcc has
squirrelled 
away in /usr/sfw/lib/gcc/.../include.  The macro USHRT_MAX
is wrapped in 
an #ifdef _KERNEL and is not getting processed.

Any suggested resolutions?  Can I somehow force gcc to use 
/usr/include/sys/types.h?

PS - I am still working on a Sun-toolchain compile, but I
was asked to 
investigate this route when I burned the machine down to
install Solaris 
10u3, before installing the forte compilers.

Thanks,
Robert Kennedy


_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
Another dumb question about Solaris compiles
user name
2007-01-07 13:34:36
On 1/5/07, Robert Kennedy <robertkmotown.cc.utexas.edu>
wrote:
...
> fts.c: In function `fts_build':
> fts.c:819: error: `USHRT_MAX' undeclared (first use in
this function)
> fts.c:819: error: (Each undeclared identifier is
reported only once
> fts.c:819: error: for each function it appears in.)
> fts.c: In function `fts_palloc':
> fts.c:1128: error: `USHRT_MAX' undeclared (first use in
this function)
> fts.c: In function `fts_safe_changedir':

This patch should "fix", its not like USHRT_MAX
does anything real or useful:
Index: fts.c
============================================================
=======
RCS file: /cvs/devel/rpm/rpmio/fts.c,v
retrieving revision 1.11.2.5
diff -u -b -B -w -p -r1.11.2.5 fts.c
--- fts.c       24 Nov 2006 17:34:48 -0000      1.11.2.5
+++ fts.c       7 Jan 2007 13:28:56 -0000
 -80,6
+80,9  static char sccsid[] = "(#)fts.c     8.6 (B
 #   define __fchdir    fchdir
 #endif

+#if !defined(USHRT_MAX)
+#define        USHRT_MAX       65535
+#endif

 /* Largest alignment size needed, minus one.
    Usually long double is the worst case.  */

> fts.c:1204: warning: passing arg 2 of `fstat' from
incompatible pointer
> type

Hmmm, this might need investigation, "struct stat64
*" is perhaps incorrect
for your solaris build environment.

73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
Another dumb question about Solaris compiles
user name
2007-01-07 14:29:08
On Sun, 7 Jan 2007, Jeff Johnson wrote:

> On 1/5/07, Robert Kennedy <robertkmotown.cc.utexas.edu> wrote:
> ...
>> fts.c: In function `fts_build':
>> fts.c:819: error: `USHRT_MAX' undeclared (first use
in this function)
>> fts.c:819: error: (Each undeclared identifier is
reported only once
>> fts.c:819: error: for each function it appears in.)
>> fts.c: In function `fts_palloc':
>> fts.c:1128: error: `USHRT_MAX' undeclared (first
use in this function)
>> fts.c: In function `fts_safe_changedir':
>
> This patch should "fix", its not like
USHRT_MAX does anything real or useful:
> Index: fts.c
>
============================================================
=======
> RCS file: /cvs/devel/rpm/rpmio/fts.c,v
> retrieving revision 1.11.2.5
> diff -u -b -B -w -p -r1.11.2.5 fts.c
> --- fts.c       24 Nov 2006 17:34:48 -0000     
1.11.2.5
> +++ fts.c       7 Jan 2007 13:28:56 -0000
>  -80,6 +80,9  static char sccsid[] = "(#)fts.c 
   8.6 (B
> #   define __fchdir    fchdir
> #endif
>
> +#if !defined(USHRT_MAX)
> +#define        USHRT_MAX       65535
> +#endif
>
> /* Largest alignment size needed, minus one.
>   Usually long double is the worst case.  */
>
>> fts.c:1204: warning: passing arg 2 of `fstat' from
incompatible pointer
>> type
>
> Hmmm, this might need investigation, "struct
stat64 *" is perhaps incorrect
> for your solaris build environment.

It is a wider problem beyond USHRT_MAX.  All the constants
that rpm
tried to use from sys/types.h (USHRT_MAX, LONG_MIN,
LONG_MAX, INT_MIN, and
INT_MAX) have the same problem.  I defined them all with -D
flags to check 
and it made it through.  My build environment is the forte
compilers.  The 
machine is 64-bit but the target should just be plain old
32-bit sparc.

Now I am running into 16 pages of "Text relocation
against unknown symbol" 
errors at the final linking stage.  My understanding of
relocation on 
SPARC architectures is lacking, but I was under the
impression that if the 
libraries were all compiled with -fPIC (or not) that it
should work out 
OK.

Cheers,
Robert Kennedy
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )