How do I compile a single source code file in the kernel?
How do I build just the kernel?

I have successfully built and installed OpenSolaris. I?ve used nighlty, bfu, 
and cap-eye Install at various times for various OpenSolaris builds. All has 
worked as documented.

I now want to experiment by making a coding change in the 
/usr/src/uts/common/fs/zfs/metaslab.c file. However, I don?t want to wait 
several hours for nightly (or even nightly ?i) to complete. Instead, I?d like 
to repetitively compile metaslab.c until I eliminate all compilation errors. 
Then I?ll like to rebuild the kernel which will include the only changes I have 
made, i.e., the changes to metaslab.c.

I have been unable to issue a dmake command that will compile just metaslab.c. 
I issued the following commands from the /usr/src/uts.

bldenv ../../../opensolaris.sh
dmake ./common/fs/zfs/metaslab.o

Apparently the include directories are not properly specified since I get 
errors such as:

common/fs/zfs/metaslab.c:28:29: sys/zfs_context.h: No such file or directory

As suggested by existing documentation, I?ve also tried issuing the following 
commands from /usr/src/uts to build the whole kernel. (I did this prior to 
making my changes to metaslab.c just to be sure I wasn?t introducing additional 
problems.):

bldenv ../../../opensolaris.sh
dmake all

Here I get errors such as:

<machine_name> --> Job errors
+ /usr/sfw/bin/gcc -fident -finline -fno-inline-functions -fno-builtin -fno-asm 
-nodefaultlibs -D__sun -m64 -mtune=opteron -Ui386 -U__i386 -fno-strict-aliasing 
-fno-unit-at-a-time -fno-optimize-sibling-cal
ls -O2 -D_ASM_INLINES -ffreestanding -mno-red-zone -msave-args -Wall 
-Wno-unknown-pragmas -Wno-missing-braces -Wno-sign-compare -Wno-parentheses 
-Wno-uninitialized -Wno-implicit-function-declaration -Wno-u
nused -Wno-trigraphs -Wno-char-subscripts -Wno-switch -gdwarf-2 -std=gnu99 
-fno-dwarf2-indirect-strings -Werror -DDIS_MEM -D_KERNEL -ffreestanding 
-D_SYSCALL32 -D_SYSCALL32_IMPL -D_ELF64 -D_DDI_STRICT -Dsu
n -D__sun -D__SVR4 -Di86pc -D_MACHDEP -DOPTERON_ERRATUM_88 -DOPTERON_ERRATUM_91 
-DOPTERON_ERRATUM_93 -DOPTERON_ERRATUM_95 -DOPTERON_ERRATUM_99 
-DOPTERON_ERRATUM_100 -DOPTERON_ERRATUM_101 -DOPTERON_ERRATUM_
108 -DOPTERON_ERRATUM_109 -DOPTERON_ERRATUM_121 -DOPTERON_ERRATUM_122 
-DOPTERON_ERRATUM_123 -DOPTERON_ERRATUM_131 -DOPTERON_WORKAROUND_6336786 
-DOPTERON_WORKAROUND_6323525 -DOPTERON_ERRATUM_172 -DC2_AUDIT 
-I../../i86pc -I/export/home/jduff/snv_68_alloc/usr/src/common -I../../intel 
-nostdinc -I../../common -c -o /tmp/.cwCAAEOGIho.o ../../i86pc/vm/hat_kdi.c 
-mcmodel=kernel
<machine_name> --> Job errors
. . .

How can I quickly compile just metaslab.c so I can eliminate compilation errors?
How do I then build just the kernel?

Thanks in advance for any help you can give me.

jduff
 
 
This message posted from opensolaris.org

Reply via email to