[gccsdk] Building UnixLib

David J. Ruck druck at druck.org.uk
Sun Feb 11 12:31:20 PST 2007


I've been trying to build the UnixLib 4.3 sources supplied with the 3.4.5r1
release, on RISC OS with both GCC and Norcroft, which is still documented as
being supported in that version. However it looks like no one has attempted
compilation on the native plaform for some time, as it doesn't work with
either compiler.

Firstly the following files are missing from the source structure:-

  !UnixLib.source.module.s.sul
  !UnixLib.source.crypt.h.crypt-private
  !UnixLib.source.crypt.h.md5
  !UnixLib.source.crypt.h.ufc-crypt
  !UnixLib.source.gdtoa.h.arith
  !UnixLib.source.gdtoa.h.fpmath
  !UnixLib.source.gdtoa.h.gdtoa
  !UnixLib.source.gdtoa.h.gdtoaimp
  !UnixLib.source.libm-dbl64.h.atnat
  !UnixLib.source.libm-dbl64.h.atnat2
  !UnixLib.source.libm-dbl64.h.branred
  !UnixLib.source.libm-dbl64.h.dla
  !UnixLib.source.libm-dbl64.h.doasin
  !UnixLib.source.libm-dbl64.h.dosincos
  !UnixLib.source.libm-dbl64.h.MathLib
  !UnixLib.source.libm-dbl64.h.mpa
  !UnixLib.source.libm-dbl64.h.mpa2
  !UnixLib.source.libm-dbl64.h.mpatan
  !UnixLib.source.libm-dbl64.h.mpexp
  !UnixLib.source.libm-dbl64.h.mplog
  !UnixLib.source.libm-dbl64.h.mpsqrt
  !UnixLib.source.libm-dbl64.h.mydefs
  !UnixLib.source.libm-dbl64.h.sincos32
  !UnixLib.source.libm-dbl64.h.tbl_asincos
  !UnixLib.source.libm-dbl64.h.tbl_powtwo
  !UnixLib.source.libm-dbl64.h.tbl_root
  !UnixLib.source.libm-dbl64.h.tbl_sincos
  !UnixLib.source.libm-dbl64.h.tbl_uatan
  !UnixLib.source.libm-dbl64.h.tbl_uexp
  !UnixLib.source.libm-dbl64.h.tbl_ulog
  !UnixLib.source.libm-dbl64.h.tbl_upow
  !UnixLib.source.libm-dbl64.h.tbl_utan
  !UnixLib.source.libm-dbl64.h.t_exp2
  !UnixLib.source.libm-dbl64.h.uasncs
  !UnixLib.source.libm-dbl64.h.uexp
  !UnixLib.source.libm-dbl64.h.ulog
  !UnixLib.source.libm-dbl64.h.upow
  !UnixLib.source.libm-dbl64.h.urem
  !UnixLib.source.libm-dbl64.h.uroot
  !UnixLib.source.libm-dbl64.h.usncs
  !UnixLib.source.libm-dbl64.h.utan
  !UnixLib.source.libm-flt32.h.t_exp2f
  !UnixLib.source.regexp.h.regcustom
  !UnixLib.source.regexp.h.regc_color
  !UnixLib.source.regexp.h.regc_cvec
  !UnixLib.source.regexp.h.regc_lex
  !UnixLib.source.regexp.h.regc_locale
  !UnixLib.source.regexp.h.regc_nfa
  !UnixLib.source.regexp.h.regerrs
  !UnixLib.source.regexp.h.rege_dfa
  !UnixLib.source.regexp.h.regguts
  !UnixLib.source.resolv.h.ifreq
  !UnixLib.source.resolv.h.res_debug
  !UnixLib.source.resolv.h.res_hconf
  !UnixLib.source.stdio.h.floatio
  !UnixLib.source.stdlib.h.rand48
  
Secondly the Makefile wont work as for GCC, and needs the following
modfications to compile and remove redundant directories:-

  36,42c36,42
  < CC = gcc
  < CCdflags = -pedantic -Wall -Wundef -Wpointer-arith -Wcast-align \
  <        -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
  <        -Wmissing-declarations -Wnested-externs -Winline -Wno-unused \
  <        -W -Wcast-qual -Wshadow
  < CCrflags =
  < CCflags = -O2 -mpoke-function-name -mthrowback -std=c99 $(CCdflags) $(CCfeatures) -isystem UnixLib: -I UnixLib:^.incl-local
  ---
  > CC = gcc
  > CCdflags = -pedantic -Wall -Wundef -Wpointer-arith -Wcast-align \
  >         -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
  >         -Wmissing-declarations -Wnested-externs -Winline -Wno-unused \
  >         -W -Wcast-qual -Wshadow
  > CCrflags =
  > CCflags = -O2 -mpoke-function-name -mthrowback -std=c99 $(CCdflags) $(CCfeatures) -isystem UnixLib: -I UnixLib:^.incl-local
  52,55c52,55
  < AS = gcc
  < ASflags = -c
  < ASdflags =
  < ASrflags = -I UnixLib:^
  ---
  > AS = gcc
  > ASdflags =
  > ASrflags =
  > ASflags = -Wa,-I../source -mthrowback -c
  64,65c64,65
  < LINKflags = -RMF
  < LINK = link
  ---
  > LINKflags = -RMF
  > LINK = link
  78,79d77
  <         @cdir complex
  <         @cdir complex.o
  108,111d105
  <         @cdir math
  <         @cdir math.o
  <         @cdir math-asm
  <         @cdir math-asm.o
  1059d1052
  <         complex.o.* \
  1074,1075d1066
  <         math.o.* \
  <         math-asm.o.* \
  1105d1095
  <         -wipe complex f~vr~c
  1120,1121d1109
  <         -wipe math f~vr~c
  <         -wipe math-asm f~vr~c



The following are changes are the few minor changes need to retain Norcroft
compatibility:-

  !UnixLib.objs.Makefile 
  32,33c32,33
  < CCrflags =
  < CCflags = -depend !Depend -throwback -fcah -IUnixLib: -JUnixLib: -I UnixLib:^.incl-local -Wdap -ccversion 553 $(CCrflags) -APCS 3/32bit/fpe3
  ---
  > CCrflags = -Otime
  > CCflags = -depend !Depend -throwback -fcah -IUnixLib: -JUnixLib: -I UnixLib:^.incl-local -Wdap $(CCrflags) -APCS 3/32bit/fpe3
  46c46
  < ASflags = -Stamp -quit -CloseExec -predefine "SOFTFLOAT SETA 0"
  ---
  > AScflags = -Stamp -quit -CloseExec -predefine "SOFTFLOAT SETA 0" -CPU ARM7M
  49c49
  < ASflags = -throwback -depend !Depend -I UnixLib:^ $(ASdflags) -APCS 3/32bit
  ---
  > ASflags = -throwback -depend !Depend -I UnixLib:^ $(AScflags) -APCS 3/32bit
    
  !UnixLib.source.crypt.c.md5-crypt
  46a47,50
  > #ifndef __GNUC__
  > #define __alignof__ sizeof
  > #endif
  > 
  
  !UnixLib.source.gcccompat.c.galloca
  10a11
  > #include <unixlib/sigstate.h>
  
  !UnixLib.source.stdio.c.vfprintf
  67a68
  > #ifdef __GNUC__
  71a73
  > #endif
  
There is a compatibility issue in ObjAsm where it objects to seemingly valid
conditional blocks of the form:-
  
    [ {SOFTFLOAT}={FALSE}
    ...
    ]
  
Which occurs in stdio.c.vfprintf, source.sys.s._jmp and sys.s._syslib, but
I'm going to raise that as a bug report to ROOL.

---druck

-- 
The ARM Club Free Software - http://www.armclub.org.uk/free/
The 32bit Conversions Page - http://www.quantumsoft.co.uk/druck/




More information about the gcc mailing list