Porting newLISP (AIX)

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
hugh.jf.chen
Posts: 7
Joined: Sun Aug 11, 2013 3:50 pm

Re: Porting newLISP (AIX)

Post by hugh.jf.chen »

All right,I was back and got the access to the aix machine so I did some test based on lutz's suggestions.

I built the util/types.c and run it,following is the output of types.c:

Code: Select all

type      bytes
---------------
char        1
char *      4
void *      4
short int   2
int         4
long        4
long int    4
long long int  8
size_t      4
float       4
double      8
long double 8
wchar_t     2
size_t      4
off_t       4
time_t      4

format input              output
------------------------------------------------
%d     0xffffffff               -1
%u     0xffffffff               4294967295
%d     0x7fffffff               2147483647
%u     0x7fffffff               2147483647
%d     0x80000000               -2147483648
%u     0x80000000               2147483648
%lld     0x7fffffffffffffffLL   9223372036854775807
%llu     0x7fffffffffffffffLL   9223372036854775807
%llx     0xffffffffffffffffLL   ffffffffffffffff
%llX     0x7fffffffffffffffLL   7fffffffffffffff
%llX     0x8000000000000000LL   8000000000000000
%llX   0xFFFFFFFFFFFFFFFFLL     ffffffffffffffff
%llX   0x7FFFFFFFFFFFFFFFLL     7fffffffffffffff
%llX   0x8000000000000000LL     8000000000000000
%lld   0xffffffffffffffffLL -1
%llu   0xffffffffffffffffLL 18446744073709551615
%lld   0x7fffffffffffffffLL 9223372036854775807
%llu   0x7fffffffffffffffLL 9223372036854775807
%lld   0x8000000000000000LL -9223372036854775808
%llu   0x8000000000000000LL 9223372036854775808

CPU is big endian
The constant __BIG_ENDIAN__ is defined by the compiler

size of struct {char, short int, int} is: 8
size of struct {char, int, short int} is: 12
size of struct {char, short int, long, int} is: 12
size of struct {char, long, short int, int} is: 16

9223372036854775807 * 1000 = -1000
11 % -4 = 3
Following are the changes I'd made to nl_filesys.c:

Code: Select all

*** newlisp-10.5.3/nl-filesys.c	Wed Jul 10 00:13:06 2013
--- newlisp-10.5.3.new/nl-filesys.c	Wed Jul 31 14:06:39 2013
***************
*** 1615,1622 ****
--- 1615,1624 ----
  #if defined(SUNOS) || defined(LINUX) || defined(CYGWIN)
  memcpy(&thisFdSet, &myFdSet, sizeof(fd_set));
  #else
+ #ifndef AIX
  FD_COPY(&myFdSet, &thisFdSet);
  #endif
+ #endif
  
  if(mode == SELECT_READ_READY)
      ready = select(FD_SETSIZE, &thisFdSet, NULL, NULL, &tv);
***************
*** 2584,2593 ****
--- 2586,2597 ----
  struct tm *ltm;
  #ifndef SUNOS
  #ifndef OS2
+ #ifndef AIX
  INT gmtoff;
  UINT isdst;
  #endif
  #endif
+ #endif
  #else /* WINDOWS */
  TIME_ZONE_INFORMATION timeZone;
  #endif
***************
*** 2607,2618 ****
--- 2611,2626 ----
  ltm = localtime((time_t *)&tv.tv_sec);
  #ifndef SUNOS
  #ifndef OS2
+ #ifndef AIX
  isdst = ltm->tm_isdst;
+ #endif
  
  #ifdef CYGWIN
  gmtoff = _timezone/60;
  #else
+ #ifndef AIX
  gmtoff = ltm->tm_gmtoff/60;
+ #endif
  #endif
  
  #endif
I still can't figure out the hung problem. If any one can give some suggestions?

hugh.jf.chen
Posts: 7
Joined: Sun Aug 11, 2013 3:50 pm

Re: Porting newLISP (AIX)

Post by hugh.jf.chen »

Well,I did more tests and found that the built executable just runs find on some aix machines while hung on some aix machines. So looks like there're some execution restrictions on some machines. I'll go to our sys admin for this problem. Thanks

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Porting newLISP (AIX)

Post by Lutz »

Glad you could figure it out Hugh. The output from types.c looks exactly as expected from the ILP32 memory model. I made a new makefile_aixILP32_utf8_gcc and also added your modifications to nl-filesys.c, but with some small changes:

Also added rickyboy's improvements to qa-libffi.

http://www.newlisp.org/downloads/develo ... nprogress/

Locked