Issues When Porting Open Source Projects to Solaris

Goal

The goal of this page is to help you more easily port your Free and Open Source Software to the Solaris or OpenSolaris operating system by identifying known issues.

We analyzed the patches in three repositories:

Every issue has "HITS" to show how many patches are found. This number only reflects current status, so there are some limitations:

  • We do not count historic upstreamed patches. So some issues with small hits actually are met quite often.
    For example: "libc printf(%s, NULL) segfaults" issue HITS is 7. This is because Sun engineers have fixed lots of such issues and got patches upstreamed. We do meet this issue very often.
  • The data we generated is from 2008-12-04 to 2008-12-09, and is not synchronized with latest patch repositories.

Use this Solaris FOSS porting issues survey to rate the importance of various issues in your experience.

This page is also a reference that shows how to write similar patches. These issues are organized into the following categories:

  • Sun Compiler
  • Different Header Files
  • Kernel and Libc Functions
  • Incompatible Tools
  • Linux Specific Libraries
  • Incompatible Device
  • Others

Charts

Issues List

Sun Compiler (HITS:168)

We use official Nevada required version
$/ws/onnv-tools/SUNWspro/SS12/bin/cc -V
cc: Sun C 5.9 SunOS_i386 Patch 124868-07 2008/10/07

  • GCC-style asm (assembly) causes build failure (HITS: 12, rating: 3.63)
    • Solution: Disable in configure.ac with "HAVE_GCC_ASM=no", or change to SunStudio recognized asm instructions. Example patch.
    • Compiler bug: 6776046
  • No definition for _inline or __inline_ (HITS: 7, rating: 3.25)
    • Solution: Use "inline" instead. Example patch or bug.
    • Compiler bug: 6793056
  • No support for anonymous unions (HITS: 2, rating: 3.42)
    • Solution: Assign the union a name. Example patch.
    • Compiler bug: 4614572 and 6525110
  • object.function() ++/-- operator causes build failure (HITS:2, rating: 2.38)
    • Solution: Use object.function()+1/object.function()-1 instead. Example patch.
  • No definition for _PRETTY_FUNCTION_ (HITS: 1, rating: 2.92)
    • Solution: Replace with G_STRFUNC. Example patch
    • Compiler bug: 6793058
  • MMX/SSE intrinsic functions are not compatible (HITS: 1, rating: 3.29)
    • Solution: Workaround case-by-case. Example patch.
      • X.org solution: Build the code that used it (the Xorg server) with gcc on x86, since the performance increase of being able to use the MMX code was significant.
    • Compiler bug: 6224421
  • No support in Sun compilers for gcc's __builtin_expect (From X.org code)
    • Solution:
      #if (!defined(_GNUC) || __GNUC_ < 3) && (!defined(_IBMC) || __IBMC_ < 900)
      #define __builtin_expect(x, y) x
      #endif
    • Compiler bug: 6603861(c) and 6603858(C++)
  • No support for gcc's __volatile keyword (From X.org code)
    • Solution:
      +#ifdef __SUNPRO_C
      +# if !defined(__volatile)
      +# define __volatile volatile
      +# endif
      +#endif
    • Compiler bug: N/A

Supported in SS12 (not counted)

Following are the issues which are now supported in SS12, so we need to remove. Read Sun Studio Express - README for more information.
These issues won't be counted in the statistics.

To be removed

  • Location of G_GNUC_INTERNAL causes build failure (HITS: 7)
    • Solution: Move G_GNUC_INTERNAL to the start of line. Example bug
    • Change in SS12: _attribute_ ((visibility ("hidden"))) is supported
    • Because of bug 6783790, these patches should not be removed before it is fixed.
  • No support zero-length arrays. (HITS: 4)
    • Solution: Set array size at least 1. Example patch
    • Change in SS12: Support for zero-length arrays
  • No support for _attribute_ ((_deprecated_)) clause (HITS: 1, rating: 3.29)
    • Solution: Remove it.
    • SS12 support lots of _attribute_ clause, this make our porting more easier.

To add additional options

  • inline function causes build failure if declaration and definition are not in same file (HITS: 18, rating: 3)
    • Solution: Remove the inline keyword. Example patch
    • New Studio 12 option -features=no%extinl will fix this issue
  • No support for empty structure (HITS: 15, rating: 3.96)
    • Solution: Add a dummy member to the structure. Example patch
    • New Studio 12 option -features=extensions turns this error into a warning.
  • void function returning a value causes build failure (HITS: 7, rating: 2.46)
    • Solution: Do not return a value. Example bug.
    • New Studio 12 option -features=extensions turns this error into a warning.

Obsolete (not counted)

  • enum array size causes build failure (HITS: 1, rating: 3.08)
    • Solution: Hardcode.

Different Header Files (HITS:21)

  • No definition for u_int8_t/u_int16_t/u_int32_t/u_int64_t causes build failure (HITS: 15, rating: 2.92)
    • Solution: Define as uint[]_t if missing. Example patch
    • Bugster 6797119
  • No definition for _u64/u32/u16/u8/s64/s32/s16/_s8 causes build failure (HITS: 3, rating: 2.25)
    • Solution: Define as uint[]_t if missing. Example patch
    • Bugster 6797119
  • Incompatibilities between Solaris PAM and Linux PAM. (HITS:3, rating: 2.79)
    • Solution: Port to Solaris PAM. Example bug or patch.

Kernel and Libc Functions (HITS:14)

  • libc printf(%s, NULL) segfaults (HITS: 7, rating: 4.29)
  • Missing asprintf()/vasprintf causes build failure (HITS: 5, rating: 4.08)
  • Missing getifaddrs() causes build failure (HITS: 3, rating: 3.5)
    • Solution: Implement missing function. Example patch or bug.
    • Bugster 6797077
  • Missing strcasestr() causes build failure (HITS: 2, rating: 3.71)
    • Solution: Implement missing function. Example patch.
    • Bugster 6797080

Already in Solaris/OpenSolaris (not counted)

  • Missing strsep() causes build failure (HITS: 4, rating: 3.38)

Incompatible Tools (HITS:166)

  • Solaris ld versus GNU ld. (HITS:110, rating: 2.79)
    • Solution: Use the Solaris version. Example issue and bug.
  • Solaris gettext versus GNU gettext. (HITS:28, rating: 3.29)
    • Solution: Use the Solaris version. Example patch.
  • Solaris shell versus Linux shell (HITS:23, rating: 3.17)
    • Solution: Use the Solaris version. Example patch.
  • Solaris sed versus Linux sed (HITS:3, rating: 3.13)
    • Solution: Use the Solaris /usr/xpg4/bin/sed or change script. Example patch.
  • Solaris awk versus Linux awk (HITS:2, rating: 3)
    • Solution: Use nawk/gawk instead. Example patch.

Linux Specific Libraries (HITS:7)

  • Lack of inotify (HITS:4, rating: 2.33)
    • Solution: Use FEN or platform-independent GIO instead. Example patch.
  • Lack of ConsoleKit (HITS:3, rating: 2.75)
    • Solution: Avoid using it. Example bug or patch.

Incompatible Devices (HITS:4)

  • No /dev/cdrom. (HITS:2, rating: 2.63)
    • Solution: Use /dev/sr0 instead. See patch.
  • Unable to access /dev/dsk/xxx. (HITS:2, rating: 2.67)
    • Solution: Use /dev/rdsk/xxx instead. Example bug or patch.

Others (HITS:9)

  • Missing data file for processes under /proc (HITS:6, rating: 2.54)
    • In Solaris there are no data files under /proc, e.g. /proc/stat /proc/partitions /proc/loadavg /proc/meminfo /proc/uptime /proc/vmstat /proc/net/dev /proc/net/ip_acct /proc/net/tcp /proc/PID/cpu /proc/PID/stat. Example patch
  • Different location of X binaries. (HITS:3, rating: 2.5)
    • Solution: Linux uses /usr/bin/, Solaris uses /usr/X11/bin/, so use /usr/X11/bin on Solaris. Example patch

References

Labels

opensolaris opensolaris Delete
solaris solaris Delete
sourcejuicer sourcejuicer Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact