[Pkg-vsquare-devel] portability patches for armel (and everything else)

Martin Guy martinwguy at yahoo.it
Sat May 3 09:23:35 UTC 2008


Hi!
   I just ported the Debian version of purelibc to armel, and the
 changes are fairly small: protect 3 or 4 obsolete system calls that
 have disappeared using
 #ifdef __NR_time
 time(...)
 #endif

 and the arch-specific define for armel (which a new ARM variant)
 defined(__ARM_EABI__) in the long list of socketcall architectures.

 In general, lists of architectures deep in source code are a long-term
 pain; most of our work in doing the armel port has been contacting
 package maintainers saying
 "please add armel to [long list of architectures not incuding armel]"
 - hundreds of hours of our and package maintainers' time to find the
 packages, get new versions uploaded, wait for all architectures
 compile the new package, check to see if it has been done etc.

 I think you would do better in socketcall.c to say
 #ifndef __NR_socketcall
  version calling individual functions
 #else
  version using __pure_socketcall
 #endif
  - i.e. test for the specific attribute that is determining, not to
 embed knowledge of which architectures have the attribute and which do
 not. The aim is to make it work on all architectures without needing
 you to maintain long lists #if defined(a) || defined(b) ||
 defined(c)... and modify it in several places every time a new
 architecture is created, or when a new version of the kernel obsoletes
 an old system call.  Worse, the same architecture may have (or not
 have) certain system calls according to the version of the kernel in
 use, so the arch-test is bogus anyway.

 I may have got the details wrong (maybe you want to trap time(), even
 when it is a library call, and the socketcall issue may be more
 complex) but I think you get the idea.

 In the attached patches I used the general scheme for the socketcall
 stuff and set "Architecture: any". If it is linux-specific, you might
 prefer to use "linux-any".
 Or if you prefer to be cautious and keep the old scheme, then
 "Architectures:" needs "armel" adding to it, and the define for
 testing for the ARM EABI architecture variant is
 defined(__ARM_EABI__), to be added to the long list of architectures
 (arm-eabi does do not have __NR_socketcall)

 Good luck with your project and with getting it fully into Debian!

 Auguri


    M
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: purelibc-0.4+armel.diff
Url: http://lists.alioth.debian.org/pipermail/pkg-vsquare-devel/attachments/20080503/d0cbd37d/attachment.txt 


More information about the Pkg-vsquare-devel mailing list