Compiling Linux Kernel on HP-UX
Hi,
I'm trying to compile the latest CVS-snapshot (19990615) on my HP 715/33 using gcc 2.7.2.2 and binutils 2.7. Compiling kernel/sched.c gives the following error:
sched.c:579: section attributes are not supported for this target
I am running HP-UX 10.20, so I cannot use the depots from ftp://puffin.external.hp.com/pub/parisc/binaries/depot/.
So the question is: do I need gcc 2.8.1 and binutils 2.9.1 to build the kernel on HP-UX or is this some other error ?
Ulrich
---------------------------------------------
Ulrich Strelow
<[email protected] or
[email protected]>
Berlin, Germany
| | Hi, | | I'm trying to compile the latest CVS-snapshot (19990615) on my HP 715/33 | using gcc 2.7.2.2 and binutils 2.7. Compiling kernel/sched.c gives the | following error: | | sched.c:579: section attributes are not supported for this target | | I am running HP-UX 10.20, so I cannot use the depots from | ftp://puffin.external.hp.com/pub/parisc/binaries/depot/. | So the question is: do I need gcc 2.8.1 and binutils 2.9.1 to build the | kernel on HP-UX or is this some other error ? |
gcc 2.8.1 isn't quite enough. Although it does support section attributes, there is a bug in the code emitted that cannot be assembled with gas 2.9.1. I sucessfully worked around it by changing the condition from a fatal error to a warning in gas.
Here is the text of the bug I submitted to gcc:
e of __attribute__((__section__())) to force code into a specific section
generates code which causes the assembler to fail.
Here is an example:
/* test.c */
int __attribute__ ((__section__ (".text.init"))) a(x) int x;
{
return(x+1);
}
int b(x)
int x;{
return(x+2);
}
int __attribute__ ((__section__ (".text.init"))) c(x) int x;{
return(x+1);
}
main(){
printf("a(0)=%d\n",a(0));
printf("b(0)=%d\n",b(0));
printf("c(0)=%d\n",c(0));
}
Here is the output of gcc:
# gcc test.c /var/tmp/cca10410.s: Assembler messages: /var/tmp/cca10410.s:59: Warning: Parameters of an existing subspace can't be modified /var/tmp/cca10410.s:59: Error: Rest of line ignored. First ignored character is`,'.
Creating the assembly language output and examining for .SUBSPA directives, we
find the following:
# gcc -S test.c # grep SUBSPA test.s
# gcc -S test.c
# grep SUBSPA test.s
.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
.SUBSPA .text.init,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY,SORT=24
.SUBSPA a
.SUBSPA $CODE$
.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
.SUBSPA .text.init,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY,SORT=24
.SUBSPA c
.SUBSPA $LIT$
.SUBSPA $CODE$
.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLYNote that the section .text.init is declared with all the parameters twice.
The second occurance should not include the parameters.
If the second declaration is edited to remove the parameters, then the code
assembles and run correctly.
# cp test.s test_fixed.s # vi test_fixed.s # diff test.s test_fixed.s 59c59 < .SUBSPA .text.init,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY,SORT=24 ---
Quoted 1 line
.SUBSPA .text.init
# gcc -o test_fixed test_fixed.s # ./test_fixed a(0)=1 b(0)=2 c(0)=1
KMB
--
+============================================================+ | Kirk Bresniker (916) 785-5677 | | 8000 Foothills Blvd | | Roseville, CA 95747-5649 | | [email protected] |
Quoted 10 lines
| | Hi, | | I'm trying to compile the latest CVS-snapshot (19990615) on my HP 715/33 | using gcc 2.7.2.2 and binutils 2.7. Compiling kernel/sched.c gives the | following error: | | sched.c:579: section attributes are not supported for this target |
Quoted 6 lines
gcc 2.8.1 isn't quite enough. Although it does support section attributes, there is a bug in the code emitted that cannot be assembled with gas 2.9.1. I sucessfully worked around it by changing the condition from a fatal error to a warning in gas.
Here is the text of the bug I submitted to gcc:
I haven't tried your sample but I don't have the the section problem with gcc-2.95 (prerelease) and binutils-2.9.4 (pre). I do have a link problem:
ld -N -e _stext arch/parisc/kernel/head.o arch/parisc/kernel/init_task.o init/ma
in.o init/version.o \ arch/parisc/kernel/kernel.o arch/parisc/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o \ fs/filesystems.a \ net/network.a \ drivers/block/block.a drivers/char/char.a drivers/net/net.a \ /ehic/a/pa/linux/arch/parisc/lib/lib.a /ehic/a/pa/linux/lib/lib.a /ehic/a/pa/linux/arch/parisc/lib/lib.a \ -o vmlinux
ld: Unsatisfied symbols:
swapper_pg_dir (data)
_stext (data)
make: *** [vmlinux] Error 1
Dave
Signature · 2 lines
J. David Anglin [email protected] National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
Ulrich,
You can get HP-UX 10.20 binaries at http://hpux.cae.wisc.edu They have gcc 2.8.1. They also have many other Open Source packages.
Andrew
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Andrew Patterson Voice: (970) 898-3261 Hewlett-Packard Company FAX: (970) 898-2180 Development Solutions Lab email: [email protected]
3404 East Harmony Road / MS 7
Fort Collins, Colorado 80525
Quoted 26 lines
Hi,
I'm trying to compile the latest CVS-snapshot (19990615) on my HP 715/33 using gcc 2.7.2.2 and binutils 2.7. Compiling
kernel/sched.cgives the following error:sched.c:579: section attributes are not supported for this target
I am running HP-UX 10.20, so I cannot use the depots from ftp://puffin.external.hp.com/pub/parisc/binaries/depot/.
So the question is: do I need gcc 2.8.1 and binutils 2.9.1 to build the kernel on HP-UX or is this some other error ?Ulrich
---------------------------------------------
Ulrich Strelow
<[email protected] or
[email protected]>
Berlin, Germany---------------------------------------------------------------------------
To unsubscribe: send e-mail to [email protected] with `unsubscribe' as the subject.