bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Fwd: sed porting trouble


From: Schmitz, Joachim
Subject: RE: Fwd: sed porting trouble
Date: Wed, 29 Sep 2010 22:33:58 +0200

Hi Bruno

The official name is NonStop Kernel.

Version number, hmm. There are several. First there are several different
architectures, TNS (outdated), TNS/R (Risc, mips, almost outdated) and TNS/E
(EPIC, Itanium). There's also NEO or Neoview, which basically is the same as
EPIC. Both come in 2 flavours, the newer of either is a blades architecture
OS versions are Cnn.mm (TNS), Dnn.mm (TNS/R, Hnn.mm and Jnn.mm (TNS/E), Nnn
and Pnn (NEO)

config.guess know only TNS/R. I've already submitted patches (to Ben
Eliston, resp. address@hidden) to also recognize TNE(E and Neo.
Here they go again:

diff -u ./build-aux/config.guess.orig ./build-aux/config.guess
--- ./build-aux/config.guess.orig       2010-09-29 15:10:40.000000000 -0500
+++ ./build-aux/config.guess    2010-09-28 11:22:46.000000000 -0500
@@ -1262,6 +1262,12 @@
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+       echo nse-tandem-nsk${UNAME_RELEASE}
+       exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
        exit ;;
diff -u ./build-aux/config.sub.orig ./build-aux/config.sub
--- ./build-aux/config.sub.orig 2009-06-15 04:05:11.000000000 -0500
+++ ./build-aux/config.sub      2010-09-28 11:22:01.000000000 -0500
@@ -830,6 +830,12 @@
        np1)
                basic_machine=np1-gould
                ;;
+       neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+       nse-tandem)
+               basic_machine=nse-tandem
+               ;;
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;


__TANDEM is the predefined C compiler macro, __hpux is not (that an
different OS altogether)

Refencence for the ACL APIs should be here:
http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02128649/c02
128649.pdf
and here:
http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02492445/c02
492445.pdf

/usr/include/sys/acl.h is the header file

It contains a couple macros:

/* cmd values used by acl() */
#define ACL_GET         0x01    /* get ACL */
#define ACL_SET         0x02    /* set ACL */
#define ACL_CNT         0x03    /* get ACL Count */

/* cmd values used by acl_save_restore() */
#define ACL_GETALL      0x04    /* get ACL */
#define ACL_SETALL      0x05    /* set ACL */
#define ACL_CNTALL      0x06    /* get ACL Count */

A struct:
struct acl {
        int             a_type;                 /* entry type */
        uid_t           a_id;                   /* user or group ID */
        unsigned short  a_perm;                 /* entry permissions */
};

Some more macros:
/*
 * Values for acl entry type (a_type field)
 */

#define USER_OBJ        0x01                    /* owner of the object */
#define USER            0x02                    /* additional users */
#define GROUP_OBJ       0x04                    /* group of the object */
#define GROUP           0x08                    /* additional groups */
#define CLASS_OBJ       0x10                    /* file group class entry */
#define OTHER_OBJ       0x20                    /* other entry */
#define ACL_DEFAULT     0x10000                 /* default entry */
#define DEF_USER_OBJ    (ACL_DEFAULT | USER_OBJ)/* default object owner */
#define DEF_USER        (ACL_DEFAULT | USER)    /* default additional users
*/
#define DEF_GROUP_OBJ   (ACL_DEFAULT | GROUP_OBJ)/* default owning group */
#define DEF_GROUP       (ACL_DEFAULT | GROUP)   /* default additional groups
*/
#define DEF_CLASS_OBJ   (ACL_DEFAULT | CLASS_OBJ)/* default class entry */
#define DEF_OTHER_OBJ   (ACL_DEFAULT | OTHER_OBJ)/* default other entry */

#define NACLBASE        4       /* number of "base" ACL entries */
                                /* (USER_OBJ, GROUP_OBJ,        */
                                /* CLASS_OBJ, & OTHER_OBJ)      */
#define NACLENTRIES    150      /* Total number of base + optional entries,
*/
                                /* arbitrarily selected to match HFS's # of
*/
                                /* optional entries (HFS only has 3 base
*/
                                /* entries; cf. NACLENTRIES in <sys/acl.h>)
*/
#define DONTCARE      0x40000   /* for pattern match */
#define IDDONTCARE    0x80000   /* for pattern match */

/* For source compatibility with HPUX, the following two NACLV aliases
   are provided: */
#define NACLVBASE    NACLBASE     /* For compatibility with HPUX */
#define NACLVENTRIES NACLENTRIES  /* For compatibility with HPUX */

and some prototypes :
/* Function prototypes */
int acl (char *, int, int, struct acl *);
int aclsort (int, int, struct acl *);

/* Following prototype provided for internal product use only */
int acl_save_restore (char *, int, int, char *);

That should answer your question for defined symbols too.

Your sample program:
$ cat foo.c
extern int acl (char *); int foo (const char *s) { return acl (s); }
$ c89 -c foo.c
  extern int acl (char *); int foo (const char *s) { return acl (s); }
                                                                 ^
"/home/jojo/foo.c", line 1: error(252): argument of type "const char *" is
          incompatible with parameter of type "char *"


1 error detected in the compilation of "foo.c".
c89: /usr/cmplr/ccombe exited, returning 2.
$

Our compiler treats this as an error rather than a warning.

Enough for today, I'll look into this again tomorrow...

Bye, Jojo

-----Original Message-----
From: Bruno Haible [mailto:address@hidden 
Sent: Wednesday, September 29, 2010 9:47 PM
To: Schmitz, Joachim
Cc: Paolo Bonzini; bug-gnulib
Subject: Re: Fwd: sed porting trouble

Hi Joachim,

> > I'm trying to port sed-4.1.5 (and 4.2.1) to HP NonStop and I'm 
> > having a couple issues with it.

This is an OS on which gnulib was never tested so far. Therefore I have to
start with a few basic questions:

  - What is the official name of the OS? NonStop? NonStop OS? NonStop UX?
    Also the version number (for reference in gnulib documentation)?

  - What is the result of config.guess?
      $ sh build-aux/config.guess

  - What are the predefined C compiler macros? __TANDEM, what else?
    __hpux also?

Then, three questions about the ACL support. First, where is a reference of
the API? I need this info for updating
 
<http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/acl-resources
.txt>

  - Which include files declares functions related to ACLs?

  - Which symbols are defined? Something like
      $ nm /usr/lib/libc.so | grep acl
    should provide the list.

> > Some are due to our picky compiler (or a potential bug in either 
> > your code or out implementation of acl())

Just a test case: When you try to compile this file with "cc -c foo.c"
======================== foo.c ======================== extern int acl (char
*); int foo (const char *s) { return acl (s); }
=======================================================
what is the result?

> > some due to differenences how
> > POSIX ACLs are implemented here:

gnulib contains a couple of unit tests for this code. sed-4.2.1 doesn't.
Therefore I'd like to ask you to repeat your effort with this tarball:
  http://www.haible.de/bruno/gnu/acltestdir.tar.gz

With your changes, does only the compilation pass, or does "make check"
also pass?

> > There is something strange going on in lib/stdlib.h, gives me a very 
> > strange error message:
> > 
> > address@hidden:/usr/local/Floss/sed-4.2.1 $ make make all-recursive 
> > Making all in lib make all-recursive source='btowc.c' 
> > object='btowc.o' libtool=no DEPDIR=.deps depmode=none bin/sh 
> > ../build-aux/depcomp cc -DHAVE_CONFIG_H -I. -I.. -I../lib -I.. 
> > -I../lib -I/usr/local/include -g -c btowc.c struct random_data ^ 
> > "/usr/local/Floss/sed-4.2.1/lib/../lib/stdlib.h", line 64: error(123):
> > expected an expression
> > {
> > ^
> > "/usr/local/Floss/sed-4.2.1/lib/../lib/stdlib.h", line 65: error(111):
> > expected a "]"
> > {
> > ^
> > "/usr/local/Floss/sed-4.2.1/lib/../lib/stdlib.h", line 65: error(158):
> > expected a ";"
> > 3 errors detected in the compilation of "btowc.c".
> > c89: /usr/cmplr/ccombe exited, returning 2.
> > *** Error code 1
> > 
> > In lib/stdlib.h.in, somewhere before 'struct random' it goes 
> > horribly wrong, haven't yet been able to spot where, might be in
lib/stdint.h?

Try to only preprocess the file:
  $ cc -DHAVE_CONFIG_H -I. -I.. -I../lib -I.. -I../lib -I/usr/local/include
-g -E btowc.c > i.c and look at i.c. Here it should be easier to spot which
tokens before 'struct random_data' are confusing the compiler.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]