# rebuild world false



## sk8harddiefast (Mar 31, 2010)

```
===> lib/csu/i386-elf (obj,depend,all,install)
rm -f .depend
CC='gcc45' mkdep -f .depend -a    -I/usr/src/lib/csu/i386-elf/../common -I/usr/src/lib/csu/i386-elf/../../libc/include /usr/src/lib/csu/i386-
elf/crt1.c /usr/src/lib/csu/i386-elf/crti.S /usr/src/lib/csu/i386-elf/crtn.S
gcc45 -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common  -I/usr/src/lib/csu/i386-elf/../../libc/include -std=gnu99   -Wsystem-headers -Werror 
-Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-
strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c 
/usr/src/lib/csu/i386-elf/crt1.c
{standard input}: Assembler messages:
{standard input}:27: Error: suffix or operands invalid for `mov'
*** Error code 1

Stop in /usr/src/lib/csu/i386-elf.
*** Error code 1

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

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

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

Stop in /usr/src.
```

i think i need a little help here


----------



## SirDice (Mar 31, 2010)

sk8harddiefast said:
			
		

> ```
> CC='gcc45'
> ```


Wrong compiler.


----------



## sk8harddiefast (Mar 31, 2010)

What i should do to fix that? I am new to freebsd and i dont know a lot of things :|


----------



## SirDice (Mar 31, 2010)

It's most likely defined in /etc/make.conf. If that file exist, remove or rename it and try again.


----------



## sk8harddiefast (Mar 31, 2010)

ok.I changed in make.conf CC=gcc45 to CC=gcc and worked!!!
But now i take this error:

```
[...]
/usr/obj/usr/src/tmp/usr/lib/libutil.so: undefined reference to `tcsetsid'
/usr/obj/usr/src/tmp/usr/lib/libutil.so: undefined reference to `pwrite'
/usr/obj/usr/src/tmp/usr/lib/libutil.so: undefined reference to `setlogin'
/usr/obj/usr/src/tmp/usr/lib/libutil.so: undefined reference to `raise'
/usr/obj/usr/src/tmp/usr/lib/libpam.so: undefined reference to `free'
/usr/obj/usr/src/tmp/usr/lib/libpam.so: undefined reference to `sigprocmask'
*** Error code 1

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

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

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

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

Stop in /usr/src.
```


----------



## SirDice (Mar 31, 2010)

Did you do a `# make clean` before restarting the build?


----------



## DutchDaemon (Mar 31, 2010)

Using _any_ compiler flags in /etc/make.conf to build the world is severely discouraged, and not at all supported.


----------



## sk8harddiefast (Mar 31, 2010)

what i suppose to write in make.conf?
this is my make.conf

```
PYTHON_DEFAULT_VERSION=python2.6
CC=gcc45
CXX=g++45
CPP=cpp45
CWARNFLAGS := ${CWARNFLAGS:N-fformat-extensions}
# added by use.perl 2010-03-23 00:22:57
PERL_VERSION=5.10.1
USE_GNOME=gtk20
```
and i changed to this:

```
PYTHON_DEFAULT_VERSION=python2.6
CC=gcc
CXX=g++45
CPP=cpp45
CWARNFLAGS := ${CWARNFLAGS:N-fformat-extensions}
# added by use.perl 2010-03-23 00:22:57
PERL_VERSION=5.10.1
USE_GNOME=gtk20
```
Also i run make clean and now i am runnning buildworld again to see if will show me error


----------



## SirDice (Mar 31, 2010)

Remove the CC, CXX, CPP and CWARNFLAGS.


----------



## DutchDaemon (Mar 31, 2010)

Or restrict them to port builds (and even there they're bound to fail on a lot of ports, cf. http://forums.freebsd.org/showthread.php?t=7454).


----------



## sk8harddiefast (Mar 31, 2010)

ok.I remove everything from /etc/make.conf
Now my make.conf is this:

```
PYTHON_DEFAULT_VERSION=python2.6
# added by use.perl 2010-03-23 00:22:57
PERL_VERSION=5.10.1
```
I made make clean on /usr/src and make buildworld again and now i take this:

```
--------------------------------------------------------------
>>> stage 1.1: legacy release compatibility shims
--------------------------------------------------------------
cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL="sh /usr/src/tools/install.sh"  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj
/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/bin  WORLDTMP=/usr/obj/usr/src/tmp  
VERSION="FreeBSD 8.0-RELEASE-p2 amd64 800107"  MAKEFLAGS="-m /usr/src/tools/build/mk  -m /usr/src/share/mk" make -f Makefile.inc1  DESTDIR=  
BOOTSTRAPPING=800107  SSP_CFLAGS=  -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED  
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF legacy
===> tools/build (obj,includes,depend,all,install)
/usr/obj/usr/src/tmp/usr/src/tools/build created for /usr/src/tools/build
cd /usr/src/tools/build; make buildincludes; make installincludes
rm -f .depend
CC='gcc45' mkdep -f .depend -a    -I/usr/obj/usr/src/tmp/legacy/usr/include /usr/src/tools/build/dummy.c
gcc45 -O2 -pipe -mssse3   -I/usr/obj/usr/src/tmp/legacy/usr/include -c /usr/src/tools/build/dummy.c
cc1: error: unrecognized command line option "-mssse3"
*** Error code 1

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

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

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

Stop in /usr/src.
```


----------



## DutchDaemon (Mar 31, 2010)

> ```
> CC='gcc45'
> ```



Old crap hanging around. Run [cmd=]cd /usr/src && make cleanworld && make cleandir[/cmd] and build the world again.


----------



## sk8harddiefast (Apr 1, 2010)

ok.I made it and i run make buildworld again but i take the same error.


----------



## DutchDaemon (Apr 1, 2010)

`$ which gcc`
`$ gcc --version`
`$ ls -ali /usr/bin/gcc /usr/bin/cc`
`$ env` (be careful not to post sensitive/personal information)


----------



## sk8harddiefast (Apr 1, 2010)

which gcc

```
/usr/bin/gcc
```
gcc --version

```
gcc (GCC) 4.2.1 20070719  [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
ls -ali /usr/bin/gcc /usr/bin/CC

```
ls -ali /usr/bin/gcc /usr/bin/CC
1036312 -r-xr-xr-x  3 root  wheel  199904 Nov 21 16:30 /usr/bin/CC
1036310 lrwxr-xr-x  1 root  wheel       5 Mar 29 02:20 /usr/bin/gcc -> gcc45
```
env

```
GLADE_CATALOG_PATH=:
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
GTK_PATH=:/usr/local/lib/gtk-2.0
ENV=/home/********/.shrc
USER=root
SSH_AUTH_SOCK=/tmp/ssh-Q5Toet8JUO/agent.1415
LIBGLADE_MODULE_PATH=:/usr/local/lib/libglade/2.0
DBUS_SESSION_BUS_ADDRESS=unix:path=/var/tmp/dbus-scm7dMGVB2,guid=dc408262628aa366a1e16d3f4bafe375
SHELL=/bin/csh
FTP_PASSIVE_MODE=YES
MAIL=/var/mail/*****
WINDOWPATH=9
BLOCKSIZE=K
_=/usr/bin/startx
SHLVL=2
PAGER=more
WINDOWID=50381526
ICEAUTHORITY=/root/.ICEauthority
TERM=xterm
PWD=/
ORBIT_SOCKETDIR=/var/tmp/orbit-*******
GLADE_MODULE_PATH=:
GLADE_PIXMAP_PATH=:
COLORTERM=Terminal
OLDPWD=/home/********
SESSION_MANAGER=local/bsdserver.bsd:/tmp/.ICE-unix/1424
DISPLAY=:0.0
LOGNAME=root
SSH_AGENT_PID=1416
EDITOR=vi
XDG_DATA_DIRS=/usr/share:/usr/local/share
HOME=/root
XAUTHORITY=/root/.Xauthority
HOSTTYPE=FreeBSD
VENDOR=unknown
OSTYPE=FreeBSD
MACHTYPE=unknown
GROUP=wheel
HOST=bsdserver.bsd
REMOTEHOST=
```


----------



## DutchDaemon (Apr 2, 2010)

sk8harddiefast said:
			
		

> which gcc
> 
> ```
> /usr/bin/gcc
> ...



There are some strange contradictions here .. So 'gcc' is actually '/usr/bin/gcc', which is a symlink to 'gcc45' (whereas it should be a hard link to '/usr/bin/cc'), but still it tells us that its version is 4.2.1 ...

You gave me the output of [cmd=]ls -ali /usr/bin/gcc /usr/bin/*CC*[/cmd], but I really wanted [cmd=]ls -ali /usr/bin/gcc /usr/bin/*cc*[/cmd]. In fact, /usr/bin/cc and /usr/bin/gcc are actually the same file (hence the same inode), and the only way you can get rid of gcc45 (which screws up buildworld) is by making sure that /usr/bin/gcc is a *hard link* to (i.e. shares the inode with) /usr/bin/cc.

On my system it looks like this:


```
[B]94246[/B] -r-xr-xr-x  2 root  wheel  365120 Mar 18 16:43 /usr/bin/cc
[B]94246[/B] -r-xr-xr-x  2 root  wheel  365120 Mar 18 16:43 /usr/bin/gcc
```

The first number is the inode, and as you can these two files are actually one and the same. Remove the /usr/bin/gcc symlink, and link /usr/bin/gcc to /usr/bin/cc with a hard link (ln). 

After that, both files should have the same inode, and your buildworld should work (after a thorough cleandir/cleanworld).


----------



## sk8harddiefast (Apr 2, 2010)

my /usr/bin/gcc was a symlink of gcc45 which is on /usr/local/bin.Now i removed CC and gcc symlink from /usr/bin, i run again which gcc and now the output is /usr/local/bin
On /usr/local/bin "ls -al gcc" command give me this output

```
ls -al gcc
lrwxr-xr-x  1 root  wheel  5 Mar 29 00:45 gcc -> gcc45
```
So i sould remove gcc symlink from /usr/local/bin and make

```
ln -s /usr/local/bin/gcc45 /usr/bin/CC
ln -s /usr/local/bin/gcc45 /usr/bin/gcc
```
Correct??


----------



## DutchDaemon (Apr 2, 2010)

That's a symlink, and it's from the wrong file to the wrong file as well ... I don't think I explained it *that* badly 

`# ln /usr/bin/cc /usr/bin/gcc`

Please don't use *CC* (uppercase) there. It's *cc* (lowercase). In Unix, the difference is extremely important.


----------



## sk8harddiefast (Apr 2, 2010)

So inside /usr/bin i must ln cc to gcc and cc and gcc are the same file.From where i take cc because in my /usr/bin i have not cc even gcc and on /usr/local/bin, i have gcc where is symlink of gcc45 (before i delete cc from /usr/bin cc was uppercase.For this reason i wrote it like that.)


----------



## DutchDaemon (Apr 2, 2010)

Is it still April Fool's Day, or do you really fail to distinguish CC from cc? I gave you the proper command. Just use it.


----------



## sk8harddiefast (Apr 2, 2010)

Ooops.sorry!!!!when you where telling for cc i was thinking that you mean CC.I think that i make a big stupidity.
Ok.I sould make this?

```
cd /usr/local/bin
ln gcc45 /usr/bin/cc
cd /usr/bin
ln cc gcc
```
and now output of ls -ali /usr/bin/cc /usr/bin/gcc sould be

```
7443418 -r-xr-xr-x  5 root  wheel  264016 Mar 29 02:06 /usr/bin/cc
7443418 -r-xr-xr-x  5 root  wheel  264016 Mar 29 02:06 /usr/bin/gcc
```
where cc and gcc are the same file


----------



## DutchDaemon (Apr 2, 2010)

Well, I hope this is the *original* cc/gcc, or you'll have to reinstall your system from CD.

You should now see this:


```
# /usr/bin/cc --version
cc (GCC) 4.2.1 20070719  [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# /usr/bin/gcc --version
gcc (GCC) 4.2.1 20070719  [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

If so, try building world again (after a cleanworld/cleandir). This should restore everything back to normal. Please don't screw around with other versions of gcc replacing the base system compilers. If you need to use them, keep them separate and call them when needed.


----------



## sk8harddiefast (Apr 2, 2010)

in fact i see this:

```
#/usr/bin/cc --version
cc (GCC) 4.5.0 20100318 (experimental)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# /usr/bin/gcc --version
gcc (GCC) 4.5.0 20100318 (experimental)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

*but*
i have keeped an backup of the old gcc (4.2) on my /usr/bin named as gcc.old 
so i made:

```
cd /usr/bin
ln gcc.old cc
ln cc gcc
```
and now output is:

```
/usr/bin/cc --version
cc (GCC) 4.2.1 20070719  [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# /usr/bin/cc --version
cc (GCC) 4.2.1 20070719  [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
and output of s -ali /usr/bin/cc /usr/bin/gcc

```
1036437 -r-xr-xr-x  3 root  wheel  417368 Mar 20 04:16 /usr/bin/cc
1036437 -r-xr-xr-x  3 root  wheel  417368 Mar 20 04:16 /usr/bin/gcc
```

You mean that always my gcc must be 4.2.1 but when i need a newer compiler i must run gcc45 from /usr/local/bin but never try to replace the default compiler with a newer?


----------



## DutchDaemon (Apr 2, 2010)

Good to see you had a backup, or you would have been in muddy waters. You should be able to recompile your OS now, unless there are more sharks in those waters. Please don't mess with the base system in the future  There's a reason why ports and packages install in /usr/local ..


----------



## sk8harddiefast (Apr 2, 2010)

ok.I understood.make buildworld now is running 
Thank you very much


----------



## DutchDaemon (Apr 2, 2010)

/usr/bin/CC (base system!) has nothing to do with gcc45 (port!). If you deleted /usr/bin/CC (why would you do that?) you could try restoring it from a CD (if you can). Unfortunately, CC is *not* a hard link to cc/gcc


```
$ ls -ali /usr/bin/cc /usr/bin/gcc /usr/bin/CC
[B]5323037[/B] -r-xr-xr-x  3 root  wheel  [B]200120[/B] Mar 24 17:09 /usr/bin/CC
5322785 -r-xr-xr-x  2 root  wheel  410336 Mar 24 17:09 /usr/bin/cc
5322785 -r-xr-xr-x  2 root  wheel  410336 Mar 24 17:09 /usr/bin/gcc
```

although it produces the same output:


```
$ /usr/bin/CC --version
CC (GCC) 4.2.1 20070719  [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```


----------



## jalla (Apr 2, 2010)

DutchDaemon said:
			
		

> /usr/bin/CC (base system!) has nothing to do with gcc45 (port!). If you deleted /usr/bin/CC (why would you do that?) you could try restoring it from a CD (if you can). Unfortunately, CC is *not* a hard link to cc/gcc



No, it's linked to c++/g++


```
gong:/usr/bin% ls -ali | grep 847896
847896 -r-xr-xr-x   3 root  wheel    199904 Nov 21 15:30 CC*
847896 -r-xr-xr-x   3 root  wheel    199904 Nov 21 15:30 c++*
847896 -r-xr-xr-x   3 root  wheel    199904 Nov 21 15:30 g++*
```


----------



## DutchDaemon (Apr 2, 2010)

I see. Hope he didn't delete those as well ... So, OP, [cmd=]ln c++ CC[/cmd] or [cmd=]ln g++ CC[/cmd] this time.


----------



## sk8harddiefast (Apr 3, 2010)

No.I was not deleted them  rebuild world finished perfect without any others errors 
With your help i stop seeing errors everywhere,all are running very good and also CC now is back on my /usr/bin


----------



## DutchDaemon (Apr 3, 2010)

Ok. Now please don't screw around with your base system compilers again  See http://www.freebsd.org/doc/en/articles/custom-gcc/article.html for a how-to on using a different gcc for ports only.


----------



## sk8harddiefast (Apr 4, 2010)

ok.Thanks


----------

