[fpc-devel] OpenBSD compiler
Pierre Free Pascal
pierre at freepascal.org
Fri Oct 7 21:52:26 CEST 2011
I just added a script rtl/openbsd/check_sys.sh to compare
Free Pascal syscall numbers in rtl/openbsd/sysnr.inc
to the values in /usr/include/sys/syscall.h
I fixed the trivial issues, but now I get those:
-bash-4.1$ ./check_sys.sh
problem for SYS_dup expected 41 line is "#define SYS_dup 41"
problem for SYS_sigaltstack expected 53 line is "#define SYS_sigaltstack
288"
problem for SYS_semsys expected 169 line is " 169 is compat_10 osemsys */"
problem for SYS_msgsys expected 170 line is " 170 is compat_10 omsgsys */"
problem for SYS_shmsys expected 170 line is " 170 is compat_10 omsgsys */"
problem for SYS_stat35 expected 188 line is " 188 is compat_35 stat35 */"
problem for SYS_fstat35 expected 189 line is " 189 is compat_35 fstat35 */"
problem for SYS_lstat35 expected 190 line is " 190 is compat_35 lstat35 */"
problem for SYS_getdirentries35 expected 196 line is "#define
SYS_ogetdirentries 196"
problem for SYS_xfspioctl expected 208 line is "#define SYS_nnpfspioctl 208"
problem for SYS_semop35 expected 222 line is " 222 is compat_35 semop */"
problem for SYS_shmget35 expected 231 line is " 231 is compat_35 shmget */"
problem for SYS___semctl35 expected 257 line is " 257 is compat_35 semctl35
*/"
problem for SYS_shmctl35 expected 258 line is " 258 is compat_35 shmctl35
*/"
problem for SYS_msgctl35 expected 259 line is " 259 is compat_35 msgctl35
*/"
problem for SYS_getpeereid expected 273 line is " 273 is compat_o47
getpeereid */"
problem for SYS_signalstack expected 288 line is "#define SYS_sigaltstack
288"
The ones with compat are probably OK,
but what about SYS_sigaltstack and SYS_signalstack,
they seem to be inversed!
I tried to cross-compile the compiler,
but it crashes inside a fsearch call...
Pierre
> -----Message d'origine-----
> De : fpc-devel-bounces at lists.freepascal.org [mailto:fpc-devel-
> bounces at lists.freepascal.org] De la part de Marco van de Voort
> Envoyé : vendredi 7 octobre 2011 18:51
> À : FPC developers' list
> Objet : Re: [fpc-devel] OpenBSD compiler
>
> In our previous episode, Tomas Hajny said:
> > > Some status update after some play yesterday evening:
> > .
> > .
> > > 4. The next big crash is, as usual for a new port, in
> > > fexpand/expandfilename/readdir.
> > .
> >
> > I assume you probably meant FindFirst rather than
FExpand/ExpandFileName,
> > right? FExpand needs only GetDir and GetEnv/GetEnvironmentVariable which
> > should hardly be a reason for a crash of any new port hopefully...
>
> Don't worry. I'm not dissing your fexpand :-)
>
> The unix implementation of getdir can actually enumerate directories.
>
> So the problem is in readdir, but on *nix ports the crash will be in
> expandfilename because getdir stresses readdir hard, and in the compiler
> that happens before the first findfirst.
>
> The problem of readdir is simply that it is one of the few core
> functionalities with a sizable userland part, and the implementations can
be
> fairly different across OSes. (with even two choices for the kernel call
> used)
>
> I ran into it already with the original FreeBSD port (done just before
1.0,
> merged in slightly after 1.0) This because in the original Linux port,
> readdir WAS a system call.
>
> Another such traditional issue is the handling of seek and truncate,
because
> they are syscalls with 64-bit types. Some OSes that call syscalls with
> values in registers still call them as if they were on the stack, and
insert
> extra zero parameters to "align", and some don't, with variations per
> architecture.
>
> _______________________________________________
> fpc-devel maillist - fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
More information about the fpc-devel
mailing list