PR# 18300 Precompiling EiffelBase SCOOP gives C compilation errors with Sun C compiler on Linux

Problem Report Summary
Submitter: prestoat2000
Category: Runtime
Priority: Medium
Date: 2012/08/14
Class: Bug
Severity: Serious
Number: 18300
Release: 7.1.88986
Confidential: No
Status: Open
Environment: Linux x86 64-bit
Synopsis: Precompiling EiffelBase SCOOP gives C compilation errors with Sun C compiler on Linux

We are experimenting with Linux x86 and Linux x86 64-bit versions of 
Eiffel 7.1.88986.  We are using the Sun C compiler 12.3 (now "Oracle Solaris
Studio") instead of gcc.  When I try to precompile base-scoop-safe.ecf
the C compiler reports the following errors:

"/home/eiffel/Eiffel7.1.88986/studio/spec/linux-x86-64/include/eif_atomops.h", line 44: cannot find include file: <sys/atomic.h>
"at15.c", line 109: warning: implicit function declaration: atomic_cas_32
"at15.c", line 154: warning: implicit function declaration: atomic_swap_32
"at15.c", line 195: warning: implicit function declaration: atomic_add_32_nv

Note that if we do use Eiffel on Linux, we plan to use the Sun C compiler.
This problem makes it hard to run the full eweasel test suite, since all
tests using precompiled SCOOP base will fail.

To Reproduce
Precompile base-scoop-safe.ecf on Linux 86 64-bit using Sun C compiler
(free for commercial use, but updates are not free of course).
Problem Report Interactions
From:prestoat2000    Date:2012/08/17    Download   
I can't find any header files named atomic.h on the Linux machine: 175% find /opt/oracle/solarisstudio12.3/include -name atomic.h 176% find /usr/include -name atomic.h

On Solaris 10 (SPARC or x86):

cantor 684% find /usr/include -name atomic.h

Perhaps there is a missing package that we need to install on RHEL.
I will ask about that today.

From:misterieking    Date:2012/08/17    Download   
Hi Dave,

The current atomic operations preprocessing is as follows.

#if defined(__SUNPRO_C)
#if defined (__SunOS_5_9)
// Atomic Operations are for Solaris 10 and above
#include <sys/atomic.h>

Does the Sun Studio C compiler on Linux include atomic.h?  The fix may be as simple as changing <sys/atomic.h> to just <atomic.h>.