# CDDL Build Error FBSD 8 Stable



## Fuh (Jan 14, 2010)

Hey Guys,

when trying a "CSUP-Update" on an ZFS-Enabled 7.2 System to 8.0 iÂ´m getting build errors in CDDL. Ill attach the Log - Could anybody help out please?

```
===> cddl/usr.bin/ctfconvert (obj,depend,all,install)
/usr/obj/usr/src/tmp/usr/src/cddl/usr.bin/ctfconvert created for /usr/src/cddl/usr.bin/ctfconvert
rm -f .depend
mkdep -f .depend -a    -DNEED_SOLARIS_BOOLEAN -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/compat/opensolaris -I/usr/src/cddl/usr.bin
/ctfconvert/../../../cddl/compat/opensolaris/include -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris -I/usr/src/cddl
/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/head -I/usr
/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/common -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib
/opensolaris/tools/ctf/cvt -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris/uts/common -DNEED_SOLARIS_BOOLEAN -I/usr
/obj/usr/src/tmp/legacy/usr/include /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/alist.c /usr/src
/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib
/opensolaris/tools/ctf/cvt/ctfconvert.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c /usr/src
/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/fixup_tdescs.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib
/opensolaris/tools/ctf/cvt/hash.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c /usr/src
/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/input.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib
/opensolaris/tools/ctf/common/list.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/common/memory.c /usr/src
/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/merge.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib
/opensolaris/tools/ctf/cvt/output.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c /usr/src
/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/stabs.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib
/opensolaris/tools/ctf/cvt/stack.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/strtab.c /usr/src
/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/common/symbol.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib
/opensolaris/tools/ctf/cvt/tdata.c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/traverse.c /usr/src
/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/util.c
echo ctfconvert: /usr/lib/libc.a /usr/obj/usr/src/tmp/legacy/usr/lib/libegacy.a >> .depend
cc -O2 -pipe -DNEED_SOLARIS_BOOLEAN -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/compat/opensolaris  -I/usr/src/cddl/usr.bin/ctfconvert
/../../../cddl/compat/opensolaris/include  -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris  -I/usr/src/cddl/usr.bin
/ctfconvert/../../../sys/cddl/contrib/opensolaris  -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/head  -I/usr/src/cddl
/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/common  -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris
/tools/ctf/cvt  -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris/uts/common -DNEED_SOLARIS_BOOLEAN -g  -Wno-unknown-
pragmas -I/usr/obj/usr/src/tmp/legacy/usr/include -c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/alist.c
...
cc -O2 -pipe -DNEED_SOLARIS_BOOLEAN -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/compat/opensolaris  -I/usr/src/cddl/usr.bin/ctfconvert
/../../../cddl/compat/opensolaris/include  -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris  -I/usr/src/cddl/usr.bin
/ctfconvert/../../../sys/cddl/contrib/opensolaris  -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/head  -I/usr/src/cddl
/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/common  -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris
/tools/ctf/cvt  -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris/uts/common -DNEED_SOLARIS_BOOLEAN -g  -Wno-unknown-
pragmas -I/usr/obj/usr/src/tmp/legacy/usr/include  -static -L/usr/obj/usr/src/tmp/legacy/usr/lib -o ctfconvert alist.o ctf.o ctfconvert.o 
dwarf.o fixup_tdescs.o hash.o iidesc.o input.o list.o memory.o merge.o output.o st_parse.o stabs.o stack.o strtab.o symbol.o tdata.o 
traverse.o util.o -lctf -ldwarf -lelf -lz -lthr -legacy
/usr/lib/libthr.a(thr_syscalls.o)(.text+0x87a): In function `___pselect':
: undefined reference to `__pselect'
*** Error code 1

Stop in /usr/src/cddl/usr.bin/ctfconvert.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
*** Error code 1
```
Thanks and kind Regards,

Jakob


----------



## SirDice (Jan 14, 2010)

Please use code tags for output. You're not csup-updating, all csup does is update the source code in /usr/src. You are currently building world.

Do you have any CFLAGS or similar in /etc/make.conf? If so, remove them.

Also make sure to do a [cmd=]make clean[/cmd] before the [cmd=]make buildworld[/cmd].


----------



## Fuh (Jan 14, 2010)

HeyHey SirDice,

thanks for your correction and advice about CFLAGS. I removed it and will now try to rebuild the world.

Kind regards,
Jakob


----------



## Fuh (Jan 14, 2010)

Hey agin,

removed the CFLAGS-Args in /etc/make.conf, then cleaned out everything: [CMD="make clean && make cleandir && make cleanworld && rm -rf /usr/obj/*"][/CMD] and tryed a rebuild. The build stops at the same file


----------



## DutchDaemon (Jan 14, 2010)

Did you use this procedure? 'Cleaning everything' may involve more than you think ..


----------



## Fuh (Jan 14, 2010)

Thats what i did:


----------



## Fuh (Jan 14, 2010)

make clean && make cleandir && make cleanworld && rm -rf /usr/obj/*


----------



## DutchDaemon (Jan 14, 2010)

Which RELENG tag are you using? RELENG_8_0 (8.0-REL) should not produce any errors, but RELENG_8 (8.0-STABLE) might, because it is a moving target (and you may have csup'ed halfway during a source code update).


----------



## Fuh (Jan 14, 2010)

*default release=cvs tag=RELENG_8_0 # 8.0 Stable


----------



## DutchDaemon (Jan 14, 2010)

That's the RELEASE + fixes tag, not STABLE.


```
RELENG_8

    The line of development for FreeBSD-8.X, also known as FreeBSD 8-STABLE

RELENG_8_0

    The release branch for FreeBSD-8.0, used only for security advisories and other critical fixes.
```

Anyway, that 8_0 one should not produce the build errors you're seeing. Anything in src.conf or (still) in make.conf that could be interfering?


----------



## SirDice (Jan 14, 2010)

DutchDaemon said:
			
		

> Anything in src.conf or (still) in make.conf that could be interfering?


Yes, when in doubt make sure both are empty or non-existent. Especially if you run into build errors during buildworld or buildkernel.


----------



## thornae (Jan 21, 2010)

I'm receiving exactly the same error (found this thread via googling the error message).

Have tried the following:

- Moved /etc/make.conf to temporary backup file (no src.conf in /etc)
- # chflags -R noschg /usr/obj/usr
- # rm -rf /usr/obj/usr
- # cd /usr/src
- # make cleanworld
- # make cleandir

No joy, same error every time. However, *this happened after an initially successful buildworld, where the make installworld died due to power failure halfway through.* 

Does that add any useful information? Anyone got any ideas on why this might be happening?


----------



## DutchDaemon (Jan 21, 2010)

Can you try this method, perhaps after moving /usr/src out of the way (preserve a custom kernel configuration if you have one) and csup'ing a pristine new source tree from scratch?

http://forums.freebsd.org/showthread.php?p=53974&#post53974


----------



## thornae (Jan 21, 2010)

....
Nope, no good, sorry. 

Moved /usr/src/, csup-ed a new tree, followed instructions again.

Still fails at step 2 with the same error as listed at the start of this thread.

Running FreeBSD 8.0-RELEASE on a Toshiba Tecra A10, if that's any use.

I'm giving up for the night, will try again tomorrow.

Thanks for the prompt response.


----------



## Fuh (Jan 21, 2010)

Hey thornae,

any new thoughts? I guess i will update the 7.2-Installation via DVD since freebsd-update even seems not to work. I also deleted my whole source-tree, diabled make.conf and src.conf but the error appears agin and agin 

Anny suggestions?

Kind Regards,

Jakob


----------



## earlmred (Jan 22, 2010)

I'm getting the same error. Error'd out on make installworld; tried to rebuild world, no joy. Moved /etc/src.conf and /etc/make.conf out of the way, cleaned, tried to rebuild, no joy.


```
cc -O2 -pipe -DNEED_SOLARIS_BOOLEAN -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/compat/opensolaris  -I/usr/src/cddl/usr.bin/ctfconvert
/../../../cddl/compat/opensolaris/include  -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris  -I/usr/src/cddl/usr.bin
/ctfconvert/../../../sys/cddl/contrib/opensolaris  -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/head  -I/usr/src/cddl
/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/common  -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris
/tools/ctf/cvt  -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris/uts/common -DNEED_SOLARIS_BOOLEAN -g  -Wno-unknown-
pragmas -I/usr/obj/usr/src/tmp/legacy/usr/include  -static -L/usr/obj/usr/src/tmp/legacy/usr/lib -o ctfconvert alist.o ctf.o ctfconvert.o 
dwarf.o fixup_tdescs.o hash.o iidesc.o input.o list.o memory.o merge.o output.o st_parse.o stabs.o stack.o strtab.o symbol.o tdata.o 
traverse.o util.o -lctf -ldwarf -lelf -lz -lthr -legacy
/usr/lib/libthr.a(thr_syscalls.o)(.text+0x87a): In function `___pselect':
: undefined reference to `__pselect'
*** Error code 1

Stop in /usr/src/cddl/usr.bin/ctfconvert.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
```

This is on amd64.


```
foghornleghorn# uname -ar
FreeBSD foghornleghorn.res.openband.net 8.0-STABLE FreeBSD 8.0-STABLE #7: Thu Jan 21 22:48:01 EST 2010     
[email]root@foghornleghorn.res.openband.net[/email]:/usr/obj/usr/src/sys/CUSTOM  amd64
```


----------



## earlmred (Jan 22, 2010)

Figured out a solution:


```
cd /usr/src/lib/libthr
make obj && make && make install
```


----------



## thornae (Jan 23, 2010)

Okay. So. (My network issues, and the resulting delay in replying, are a tale for another day.)

Suffice it to say, I have recovered my install, thanks to the advice of various gurus. Specific thanks to Michael Graziano and the semi-divine knowledge of Daniel O'Connor.

Here's the breakdown.

For me, the error occurred on my amd64 system because the [font="monospace"]make installworld[/font] process was interrupted, and - mea culpa - I re-ran [font="monospace"]make buildworld[/font] instead of trying to continue with [font="monospace"]make installworld[/font]. This royally screwed things up.
Daniel spotted this first:


> Your installed world is no longer in sync.. I would have suggested just
> rerunning installworld but it's too late now.


...shortly followed by Michael:


> Methinks your problem may have something to do with the interrupted installworld. FTF reboot single-user and re-run installworld...



I took Michael's next advice (but see **below for another method):


> For your immediate problem, consider upgrading with sysinstall. It will get you known good binaries & libs....
> 
> 
> .... But make sure you have a GOOD BACKUP before using sysinstall's upgrade option. IDK how well tested that is these days.



Here's how I did it (AFTER MAKING A *GOOD BACKUP*):


Inserted my FreeBSD 8.0 DVD
Booted (from hard-drive) to single user mode
mounted all as rw:

```
# mount -u -w /
# mount -a
```

ran 
	
	



```
# /usr/sbin/sysinstall
```

selected "Upgrade"
selected distributions [font="monospace"]base[/font], [font="monospace"]kernels[/font] and [font="monospace"]source[/font].
chose [font="monospace"]CD/DVD[/font] as the source
crossed fingers and other superstitious nonsense, and waited.

After the upgrade finished and I rebooted, the bootloader failed to find the kernel.
But don't panic: a simple 
	
	



```
# boot GENERIC
```
 got me past that. 
The first thing I did then was 
	
	



```
# csup -L2 /usr/local/etc/cvsup/stable.supfile
```
 and then followed the recommended world update protocol (24.7.1).

Thankfully, with no power failures this time around, this got me to where I'd been trying to get to in the first place. The crisis is over, my FreeBSD system is up to date, and I've moved on to a different crisis entirely.

Thanks to all for the various advice and support. Despite all this, FreeBSD is still being less frustrating for me than Fedora 12.


**For those of you who wish to try it, Daniel offered another method:


> Probably the simplest thing would be to unpack a binary base install blob (from a release close to what you are running) onto your system to overwrite the half & half on there now. Then re-do [font="monospace"]buildworld[/font]...
> 
> 
> ( The other option would be to do the [font="monospace"]buildworld [/font]on something else and then mount [font="monospace"]/usr/src[/font] and [font="monospace"]/usr/obj[/font] from it using NFS and do [font="monospace"]installworld[/font].. )
> ...



Good luck.


----------



## thornae (Jan 23, 2010)

I did find a solution, and made a long post about it here last night, but it hasn't shown up yet. Perhaps it's awaiting a moderator to approve it...

In short, this happened due to an interrupted make buildworld.
I used sysinstall to upgrade back to where I started, but there are other ways.


----------



## DutchDaemon (Jan 23, 2010)

Sorry, got held up in mod queue.


----------



## vr6flow (Mar 5, 2010)

cd /usr/src
make clean && make cleandir && make cleanworld 
cd /usr/src/lib/libthr
make && make install && make obj

and re-run the 'make buildworld' process again... that should take care of the issue


----------

