Bug 691453 - error, patch and warnings from sunstudio linux
Summary: error, patch and warnings from sunstudio linux
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Build Process (show other bugs)
Version: master
Hardware: Other Linux
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-12 07:14 UTC by Hin-Tak Leung
Modified: 2010-12-24 00:29 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
build log with 'ln -s base/unixansi.mak Makefile ; make' showing conflicting int8_t types (3.43 KB, text/plain)
2010-07-12 07:14 UTC, Hin-Tak Leung
Details
time struct related error compiling with sunstudio (71.38 KB, text/plain)
2010-07-12 07:16 UTC, Hin-Tak Leung
Details
build log after the time_.h change. (679.76 KB, text/plain)
2010-07-12 07:22 UTC, Hin-Tak Leung
Details
removing -rdynamics, the rest of the warnings. (114.70 KB, text/plain)
2010-07-12 07:24 UTC, Hin-Tak Leung
Details
patch for -rdynamic (516 bytes, patch)
2010-12-24 00:25 UTC, Alex Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hin-Tak Leung 2010-07-12 07:14:06 UTC
Created attachment 6461 [details]
build log with 'ln -s base/unixansi.mak Makefile ; make' showing conflicting int8_t types

Tried building with SunStudio on linux. "ln -s base/unixansi.mak Makefile; make" dies very early and painfully from conflicting types with int8_t/int16_t/int32_t in base/stdint_.h (not having HAVE_STDINT_H defined) after compiling about 10 files.

Then tried CC=/opt/sun/sunstudio12.1/bin/cc ./configure (Which would probe and define the HAVE_*_H's), this works a bit better but dies at some missing <time.h> related functions. I have a patch for that.

After the patch, it goes almost to completion except one needs to remove "-rdynamic" from the final linking, as -r has different meanings to SunStudio compared to gcc.
Comment 1 Hin-Tak Leung 2010-07-12 07:16:15 UTC
Created attachment 6462 [details]
time struct related error compiling with sunstudio

build log with time-struct related error compiling with sunstudio
Comment 2 Hin-Tak Leung 2010-07-12 07:20:25 UTC
The time struct problem can be worked around by a __SUNPRO_C as below (just like the __INTEL_COMPILER, it seems). Chris, can you give this a try to see how it fares on Solaris with Sunstudio? (i.e. review and possibly commit)

--------------------------
diff --git a/base/time_.h b/base/time_.h
index 2aed563..c06573f 100644
--- a/base/time_.h
+++ b/base/time_.h
@@ -35,7 +35,7 @@
 #  include <sys/time.h>
 #  if defined(Plan9) || defined(M_UNIX) || defined(_IBMR2) || \
       defined(_SEQUENT_) || defined(__GNUC__) || defined(__INTEL_COMPILER) ||\
-      defined(__hpux)
+      defined(__hpux) || defined(__SUNPRO_C)
      /* Plan 9, SCO, AIX and Sequent's DYNIX/ptx need both time.h and
       * sys/time.h! As of version 2.2, at least some glibc
       * installations also require both files. 
-------------------

with this small change, compilation almost goes to completion until the last part where -rdynamic needs to be removed (this probably does not apply to solaris).
Comment 3 Hin-Tak Leung 2010-07-12 07:22:32 UTC
Created attachment 6463 [details]
build log after the time_.h change.

It runs almost to completion except for -rdynamic .
Comment 4 Hin-Tak Leung 2010-07-12 07:24:29 UTC
Created attachment 6464 [details]
removing -rdynamics, the rest of the warnings.

removing -rdynamic, and the rest of the warnings.

Probably should review what -rdynamic does and whether it is needed.
Comment 5 Till Kamppeter 2010-07-30 09:59:49 UTC
Hin-Tak, I comitted your patch of the initial posting as rev 11557.
Comment 6 Alex Cherepanov 2010-12-24 00:25:12 UTC
Created attachment 7061 [details]
patch for -rdynamic

Limit the use of -rdynamic flag to GCC on Linux. This flags is supported
by GCC only if the platform has ELF executable format. Bug 691453.
Comment 7 Alex Cherepanov 2010-12-24 00:29:28 UTC
The patch has been committed as a rev. 11976.