home *** CD-ROM | disk | FTP | other *** search
/ Amiga GigaPD 3 / Amiga_GigaPD_v3_3of3.iso / netbsd / docs / mailinglist-archive / 1993-11 / text0175.txt < prev    next >
Encoding:
Text File  |  1993-06-25  |  4.6 KB  |  155 lines

  1.  
  2. > > 6.  To compile the kernel, you need the libc stuff from a site that
  3. > > has the source for the NetBSD-current distribution (libc has bcmp.s,
  4. > > bzero.s, and a whole mess of other little files that are insisted
  5. > > upon (I got the libc stuff from agate.berkeley.edu)).  A question
  6. > > here: When making the kernel, "cpp -E -Iwhatever foo.s | as -o foo.o"
  7. > > grumbles about "_ somelabel" being invalid.  The problem is this space
  8. > > here ------------^.  From what I can tell, "ENTRY(foo)" is being
  9. > > converted to "_ foo:" by cpp instead of "_foo:".  Does anyone know why
  10. > > this space is being (incorrectly?) generated by cpp, and/or how to
  11. > > solve the problem.  I ended up compiling all those little .s files
  12. > > myself using "cpp -traditional foo.s | as -o foo.o" (and 
  13. > > "cpp -traditional -DPROF foo.s | as -o foo.po" when it came time for
  14. > > the profiling stuff), but it would be kind of nice to get this
  15. > > somewhat automated... 
  16.  
  17. > Replace the /**/ in DEFS.h and SYS.h with ##.
  18.  
  19. There's a little more involved, as you also need to escape the `#' in
  20. the asm statements.  A better solution (borrowed from InterViews) is
  21. to detect the preprocessor type and conditionally include code.  A
  22. patch follows.
  23.  
  24. Does anyone know what to do with `ALIGNBYTES' in lib/libc/gen/fts.c?
  25. It doesn't appear to exist anywhere.
  26.  
  27. =========================================================================
  28. Eduardo Horvath                eeh@btr.com
  29.                     ..!{decwrl,mips,fernwood}!btr!eeh
  30.     "Trust me, I am cognizant of what I am doing." - Hammeroid
  31.  
  32. *** lib/libc/arch/amiga/SYS.h~    Sat Nov 20 02:39:23 1993
  33. --- lib/libc/arch/amiga/SYS.h    Sat Nov 20 02:45:49 1993
  34. ***************
  35. *** 40,66 ****
  36.   
  37.   #include <sys/syscall.h>
  38.   
  39. ! #ifdef _STDC_
  40.   #ifdef PROF
  41.   #ifdef __GNUC__
  42. ! #define    ENTRY(x)    .globl _##x; .even; _##x:; .data; PROF##x:; \
  43. !             .long 0; .text; link a6,\#0; lea PROF##x,a0; \
  44.               jbsr mcount; unlk a6
  45.   #else
  46. ! #define    ENTRY(x)    .globl _##x; .even; _##x:; .data; PROF##x:; \
  47. !             .long 0; .text; lea PROF##x,a0; jbsr mcount
  48.   #endif
  49.   #else
  50. ! #define    ENTRY(x)    .globl _##x; .even; _##x:
  51.   #endif PROF
  52. ! #define    SYSCALL(x)    .even; err: jmp cerror; ENTRY(x); movl \#SYS_##x,d0; \
  53.               trap \#0; jcs err
  54.   #define    RSYSCALL(x)    SYSCALL(x); rts
  55. ! #define    PSEUDO(x,y)    ENTRY(x); movl \#SYS_##y,d0; trap \#0; rts
  56.   
  57.   #define    ASMSTR        .asciz
  58. -     .globl    cerror
  59.   #else
  60.   
  61.   #ifdef PROF
  62. --- 40,64 ----
  63.   
  64.   #include <sys/syscall.h>
  65.   
  66. ! #ifdef __STDC__
  67.   #ifdef PROF
  68.   #ifdef __GNUC__
  69. ! #define    ENTRY(x)    .globl _##x; .even; _##x##:; .data; PROF##x##:; \
  70. !             .long 0; .text; link a6,\#0; lea PROF##x##,a0; \
  71.               jbsr mcount; unlk a6
  72.   #else
  73. ! #define    ENTRY(x)    .globl _##x; .even; _##x##:; .data; PROF##x##:; \
  74. !             .long 0; .text; lea PROF##x##,a0; jbsr mcount
  75.   #endif
  76.   #else
  77. ! #define    ENTRY(x)    .globl _##x; .even; _##x##:
  78.   #endif PROF
  79. ! #define    SYSCALL(x)    .even; err: jmp cerror; ENTRY(x); movl \#SYS_##x##,d0; \
  80.               trap \#0; jcs err
  81.   #define    RSYSCALL(x)    SYSCALL(x); rts
  82. ! #define    PSEUDO(x,y)    ENTRY(x); movl \#SYS_##y##,d0; trap \#0; rts
  83.   
  84.   #define    ASMSTR        .asciz
  85.   #else
  86.   
  87.   #ifdef PROF
  88. ***************
  89. *** 76,87 ****
  90.   #define    ENTRY(x)    .globl _/**/x; .even; _/**/x:
  91.   #endif PROF
  92.   #define    SYSCALL(x)    .even; err: jmp cerror; ENTRY(x); movl #SYS_/**/x,d0; \
  93. !             trap \#0; jcs err
  94.   #define    RSYSCALL(x)    SYSCALL(x); rts
  95.   #define    PSEUDO(x,y)    ENTRY(x); movl #SYS_/**/y,d0; trap #0; rts
  96.   
  97.   #define    ASMSTR        .asciz
  98.   
  99.       .globl    cerror
  100. - #endif
  101. --- 74,84 ----
  102.   #define    ENTRY(x)    .globl _/**/x; .even; _/**/x:
  103.   #endif PROF
  104.   #define    SYSCALL(x)    .even; err: jmp cerror; ENTRY(x); movl #SYS_/**/x,d0; \
  105. !             trap #0; jcs err
  106.   #define    RSYSCALL(x)    SYSCALL(x); rts
  107.   #define    PSEUDO(x,y)    ENTRY(x); movl #SYS_/**/y,d0; trap #0; rts
  108.   
  109.   #define    ASMSTR        .asciz
  110. + #endif
  111.   
  112.       .globl    cerror
  113. *** lib/libc/arch/amiga/DEFS.h~    Sat Nov 20 02:22:24 1993
  114. --- lib/libc/arch/amiga/DEFS.h    Sat Nov 20 04:00:46 1993
  115. ***************
  116. *** 38,46 ****
  117. --- 38,63 ----
  118.    *    $Id: DEFS.h,v 1.1 1993/10/07 00:17:29 cgd Exp $
  119.    */
  120.   
  121. + #ifdef __STDC__
  122.   #ifdef PROF
  123.   #ifdef __GNUC__
  124.   #define    ENTRY(x) \
  125. +     .globl _##x; .even; _##x##:; .data; PROF##x##:; .long 0; .text; \
  126. +     link a6,\#0; lea PROF##x##,a0; jsr mcount; unlk a6
  127. + #else
  128. + #define    ENTRY(x) \
  129. +     .globl _##x; .even; _##x##:; .data; PROF##x##:; .long 0; .text; \
  130. +     lea PROF##x,a0; jsr mcount
  131. + #endif
  132. + #else
  133. + #define    ENTRY(x) \
  134. +     .globl _##x; .even; _##x##:
  135. + #endif
  136. + #else
  137. + #ifdef PROF
  138. + #ifdef __GNUC__
  139. + #define    ENTRY(x) \
  140.       .globl _/**/x; .even; _/**/x:; .data; PROF/**/x:; .long 0; .text; \
  141.       link a6,#0; lea PROF/**/x,a0; jsr mcount; unlk a6
  142.   #else
  143. ***************
  144. *** 51,54 ****
  145. --- 68,72 ----
  146.   #else
  147.   #define    ENTRY(x) \
  148.       .globl _/**/x; .even; _/**/x:
  149. + #endif
  150.   #endif
  151.  
  152.