[Open64-devel] r2330 - in trunk: doc osprey/be/cg osprey/targia32_x8664/driver
Brought to you by:
ributzka,
suneeljain
From: <sv...@op...> - 2009-08-20 09:32:24
|
Author: dongyuan Date: 2009-08-20 05:32:13 -0400 (Thu, 20 Aug 2009) New Revision: 2330 Modified: trunk/doc/KernelCompile trunk/osprey/be/cg/cgemit.cxx trunk/osprey/targia32_x8664/driver/kdriver Log: Remove $ for rodata section address reference, linker uses it during linux kernel linking. Refine gcc option filter for kernel compilation. Now we can build Linux kernel 2.6.27.7/9 Modified: trunk/doc/KernelCompile =================================================================== --- trunk/doc/KernelCompile 2009-08-18 20:06:46 UTC (rev 2329) +++ trunk/doc/KernelCompile 2009-08-20 09:32:13 UTC (rev 2330) @@ -1,4 +1,6 @@ /* + Copyright (C) 2008-2009, Tsinghua University. All rights reserved. + Copyright (C) 2006-2007, Hewlett-Packard Company & Tsinghua University. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -25,9 +27,25 @@ */ KernelCompile +================================================================================================= +Menu +------------------------------------------------ +I. Introduction +II. The scripts +III. Kernel compilation +IV. Known problems +V. Developers + +I. Introduction +------------------------------------------------ +This document explains the status of open64 linux kernel compilation. +Tested platform: x86/IA64/PowerPC32 + +II. The scripts +------------------------------------------------ We use a shell scripts file to handle options for kernel compilation. -It locates in kpro64/targia64_ia64_nodebug/driver/ +It locates in osprey/targtarget_target[-nodebug]/driver/ Scripts file kdriver mainly does these things: 1)ignores these options onlyfor GCC and do not pass them to opencc. @@ -44,10 +62,28 @@ I'd like to add it as a seperate file. It is just for kernel building. For other application, we still use the origional driver. +III. Kernel compilation +------------------------------------------------ When we build kernel, we use it like this: make CC=kopencc (kopencc=kdriver, just a symbol link) then, it will help us to reorgnize the options. That's the way we use it now. + +X86 Example: +Tested platform: ubuntu linux 8.10/X86 with local +gcc 4.2.4/g++4.1.3/Binutils 2.18.93. +1) download and uncompress linux kernel package (version 2.6.27.7/9) +2) make i386_defconfig +3) make CC=kopencc + Good luck and enjoy it. + +IV. Known problems +------------------------------------------------ +We still need a patch for kernel compilation for IA64 and PPC32. +If you want it, please see our website. + +If you want source code and more infomation, please visit our website: + http://soft.cs.tsinghua.edu.cn/soft/software.html Modified: trunk/osprey/be/cg/cgemit.cxx =================================================================== --- trunk/osprey/be/cg/cgemit.cxx 2009-08-18 20:06:46 UTC (rev 2329) +++ trunk/osprey/be/cg/cgemit.cxx 2009-08-20 09:32:13 UTC (rev 2330) @@ -3153,13 +3153,15 @@ name = ST_name( st ); #if defined (TARG_X8664) + //remove "$" for rodata section address reference + //https://bugs.open64.net/show_bug.cgi?id=494 if (!memory /* bug 14399 */ && !strcmp (name, ".rodata")) { // This is the address of a string constant, treat it similar // to a numeric constant. (bug 14390) if( base_ofst == 0 ) - sprintf( buf, "$%s", name ); + sprintf( buf, "%s", name ); else - sprintf( buf, "$%s+%d", name, (int)base_ofst ); + sprintf( buf, "%s+%d", name, (int)base_ofst ); } else { #endif Modified: trunk/osprey/targia32_x8664/driver/kdriver =================================================================== --- trunk/osprey/targia32_x8664/driver/kdriver 2009-08-18 20:06:46 UTC (rev 2329) +++ trunk/osprey/targia32_x8664/driver/kdriver 2009-08-20 09:32:13 UTC (rev 2330) @@ -11,8 +11,6 @@ OPENCC_OPTS=" -O2 " #Use gcc 4 front end for x86 machine OPENCC_OPTS=" $OPENCC_OPTS -m32 -gnu4 " -#Open64 Debug mode -OPENCC_OPTS=" $OPENCC_OPTS -keep -show " #speculation off for kernel compilation #It's only for IA64. If you are compileing kernel for IA64, uncomment next line #OPENCC_OPTS=" $OPENCC_OPTS -Wb,-IPFEC:spec=off -IPFEC:spec=off " @@ -64,7 +62,7 @@ | -mpreferred-stack-boundary=2 | -march=* | -malign-functions=* \ | -malign-jumps=* | -malign-loops=* | -gstabs \ | -fno-optimize-sibling-calls \ -| -mconstant-gp \ +| -mconstant-gp | -mno-mmx | -fno-asynchronous-unwind-tables \ | -mtune=* \ | -msoft-float | -mregparm=3 | -maccumulate-outgoing-args \ | -dynamic-linker ) |