On 02/09/2015 14:18, Joerg Schilling wrote:
Alexander Pyhalov via illumos-discuss <[email protected]> wrote:

I've tried to compile and test Joyent cpp with Richard Lowe's fixes -
https://github.com/richlowe/illumos-extra/tree/cpp/compat/cpp

One more issue: I can't build illumos-gate with this cpp:

With Joyent cpp (without Richard's patches) I can succesfully build
illumos-gate. But there are still a lot of differences between Sun cpp
and Joyent cpp output.

Just a note, this is not from Joyent, this is my cpp. I created it in September 2010 and I am still maintaining it. It may make sense to try the original first:


https://sourceforge.net/p/schillix-on/schillix-on/ci/default/tree/usr/src/cmd/cpp/

The newst changes from here:

        http://sourceforge.net/projects/schilytools/files/

are not relevant for Solaris.

Note that the my original code has been checked to create basically the same
output as cpp from Sun.

If you find any problems in the original code, please keep me informed.

Jörg


Thanks.
The output is also not identical to Sun cpp.


For example,
--- /usr/include/asm/byteorder.h (Sun cpp)
+++ /usr/include/asm/byteorder.h (Schilix cpp)
@@ -1,4 +1,6 @@
-typedef signed char            int8_t;
+typedef        struct _label_t { long val[6]; } label_t;
+typedef        unsigned char   lock_t;
+typedef char                   int8_t;
 typedef short                  int16_t;
 typedef int                    int32_t;
 typedef        long long               int64_t;
@@ -10,7 +12,7 @@
 typedef uint64_t               uintmax_t;
 typedef        int                     intptr_t;
 typedef        unsigned int            uintptr_t;
-typedef signed char            int_fast8_t;
+typedef char                   int_fast8_t;
 typedef int                    int_fast16_t;
 typedef int                    int_fast32_t;
 typedef long long              int_fast64_t;
@@ -18,7 +20,7 @@
 typedef unsigned int           uint_fast16_t;
 typedef unsigned int           uint_fast32_t;
 typedef unsigned long long     uint_fast64_t;
-typedef signed char            int_least8_t;
+typedef char                   int_least8_t;
 typedef short                  int_least16_t;
 typedef int                    int_least32_t;
 typedef long long              int_least64_t;
@@ -72,6 +74,20 @@
 typedef        u_longlong_t    u_offset_t;
 typedef u_longlong_t   len_t;
 typedef        u_longlong_t    diskaddr_t;
+typedef union {
+       offset_t        _f;
+       struct {
+               int32_t _l;
+               int32_t _u;
+       } _p;
+} lloff_t;
+typedef union {
+       longlong_t      _f;
+       struct {
+               int32_t _l;
+               int32_t _u;
+       } _p;
+} lldaddr_t;
 typedef uint_t k_fltset_t;
 typedef        long            id_t;
 typedef id_t           lgrp_id_t;
@@ -294,7 +310,7 @@
 typedef        long    fd_mask;
 typedef        long    fds_mask;
 typedef        struct fd_set {
- long fds_bits[(((1024)+(( (sizeof (fds_mask) * 8))-1))/( (sizeof (fds_mask) * 8)))]; + long fds_bits[ (((1024)+(( (sizeof (fds_mask) * 8) )-1))/( (sizeof (fds_mask) * 8) ))];
 } fd_set;
 extern int select(int, fd_set *, fd_set *,
        fd_set *, struct timeval *);



Also I have some issues with DTrace when I try to compile illumos-gate with this cpp:

dtrace: failed to compile script ../port/threads/plockstat.d: "/usr/include/sys/int_types.h", line 75: typedef redeclared: int8_t
dmake: Warning: Target `libc.so.1' not remade because of errors
Current working directory /export/home/alp/srcs/oi-userland/components/illumos/illumos-gate/illumos-gate/usr/src/lib/libc/i386
*** Error code 1
The following command caused the error:
cd i386; pwd; VERSION='illumos-9ef2834' dmake libc.so.1


For now, Joyent cpp (I mean cpp which is found at Joyent illumos-extra tree, which is based on your version) is the best bet - at least it can be used to compile illumos-gate.

--
Best regards,
Alexander Pyhalov,
system administrator of Southern Federal University IT department



-------------------------------------------
illumos-discuss
Archives: https://www.listbox.com/member/archive/182180/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182180/21175430-2e6923be
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=21175430&id_secret=21175430-6a77cda4
Powered by Listbox: http://www.listbox.com

Reply via email to