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:
- spec-files(r16904) Number of patches: 678
- spec-files-other(r574) Number of patches: 818
- spec-files-extra (r1557) Number of patches: 99
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
- This chart shows issues statistics by category
- This chart shows issues statistics by HITS
- This chart shows issues statistics by rating
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
- No support for GCC options: -Wall/-Werror/-Wl (HITS: 143, rating: 3.38)
- Solution: Remove such options. Example patch.
- X.org Solution: Checks for the compiler in a configure macro to set either -v for Sun Studio or the -W flags for gcc: http://cgit.freedesktop.org/xorg/util/macros/tree/xorg-macros.m4.in#n436
- Compiler bug: 6793041
- Solution: Remove such options. Example patch.
- 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)
- 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
- Solution: Workaround case-by-case. Example patch.
- 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++)
- Solution:
- 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
- Solution:
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
- No definition for _FUNCTION_ (HITS: 21)
- Solution: Replace with G_STRFUNC. Example patch
- X.org Solution: use the C99 equivalent version that Studio 12 already supports - for instance, in Mesa: http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/main/glheader.h#n288
- _FUNCTION_ is supported in Sun Studio Express 2008/11, remove patches after it is synced in /ws
- Location of G_GNUC_INTERNAL causes build failure (HITS: 7)
- 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)
- No definition for _u64/u32/u16/u8/s64/s32/s16/_s8 causes build failure (HITS: 3, rating: 2.25)
- Different headers/names for byteswapping macros (From X.org code)
- Solution
- Use platform-independent generic versions, such as: http://cgit.freedesktop.org/xorg/xserver/tree/glx/glxbyteorder.h
- Or use Solaris <sys/byteorder.h> versions, as in: http://cgit.freedesktop.org/xorg/lib/libpciaccess/tree/src/common_interface.c#n39
- Bugster 6729208
- Solution
- Incompatibilities between Solaris PAM and Linux PAM. (HITS:3, rating: 2.79)
Kernel and Libc Functions (HITS:14)
- libc printf(%s, NULL) segfaults (HITS: 7, rating: 4.29)
- Solution: Check NULL before calling print. Example patch
- PSARC 2008/403, Bugster 6724478
- Missing asprintf()/vasprintf causes build failure (HITS: 5, rating: 4.08)
- Solution: Implement missing function or use snprintf instead. Example patch.
- PSARC 2008/778, Bugster 4508459
- Missing getifaddrs() causes build failure (HITS: 3, rating: 3.5)
- Missing strcasestr() causes build failure (HITS: 2, rating: 3.71)
- Functions to get the name of the running program (From X.org code)
- Solution: On Solaris, use basename(getexecname()) where BSD uses getprogname() & Linux uses program_invocation_short_name, as shown in: http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/dri/common/xmlconfig.c#n51
Already in Solaris/OpenSolaris (not counted)
- Missing strsep() causes build failure (HITS: 4, rating: 3.38)
- Solution: Implement missing function. Example patch.
- PSARC 2008/305, Bugster 4383867, already in since snv_99
Incompatible Tools (HITS:166)
- Solaris ld versus GNU ld. (HITS:110, rating: 2.79)
- 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.
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)
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
- How to check out the spec files from repositories
- svn co svn+ssh://anon@svn.opensolaris.org/svn/jds/spec-files/trunk spec-files
- svn co svn+ssh://anon@svn.opensolaris.org/svn/jds/spec-files-other/trunk spec-files-other
- svn co https://pkgbuild.svn.sourceforge.net/svnroot/pkgbuild/spec-files-extra/trunk spec-files-extra