# Error compiling gentoo-sources-2.6.29

## ONEEYEMAN

Hi, ALL,

I am trying to go from 2.6.23 to 2.6.29.

I successfully configured new kernel, but issuing "make && make modules_install" fails with following:

```

IgorsGentooOnNetwork linux # make && make modules_install

scripts/kconfig/conf -s arch/x86/Kconfig

  CHK     include/linux/version.h

  UPD     include/linux/version.h

  CHK     include/linux/utsrelease.h

  UPD     include/linux/utsrelease.h

  SYMLINK include/asm -> include/asm-x86

  CC      kernel/bounds.s

In file included from include/linux/compiler-gcc.h:86,

                 from include/linux/compiler.h:40,

                 from include/linux/stddef.h:4,

                 from include/linux/posix_types.h:4,

                 from include/linux/types.h:11,

                 from include/linux/page-flags.h:8,

                 from kernel/bounds.c:9:

include/linux/compiler-gcc4.h:7:3: error: #error Your version of gcc miscompiles the __weak directive

make[1]: *** [kernel/bounds.s] Error 1

make: *** [prepare0] Error 2

```

```

IgorsGentooOnNetwork linux # emerge --info

Portage 2.1.4.5 (default/linux/x86/2008.0, gcc-4.1.1, glibc-2.6.1-r0, 2.6.23-gentoo-r8 i686)

=================================================================

System uname: 2.6.23-gentoo-r8 i686 Genuine Intel(R) CPU           T1350  @ 1.86GHz

Timestamp of tree: Sun, 28 Jun 2009 06:15:01 +0000

ccache version 2.4 [enabled]

app-shells/bash:     3.2_p17-r1

dev-lang/python:     2.4.4-r9

dev-python/pycrypto: 2.0.1-r6

dev-util/ccache:     2.4-r7

sys-apps/baselayout: 1.12.6

sys-apps/sandbox:    1.3.1

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.16.1-r3

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.17-r1

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-Os -march=prescott -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-Os -march=prescott -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://gentoo.osuosl.org/ "

LDFLAGS="-Wl,-O1"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"

USE="X a52 acl acpi alsa apm berkdb bzip2 cdr clamav cli cracklib crypt dri dvd dvdr freetds gdbm gnome gpm gtk gtk2 hal iconv ipv6 isdnlog lm_sensors midi mplayer mssql mudflap ncurses nls nptl nptlonly odbc opengl openmp pam pcre pmu pppd python readline reflection session spl ssl sybase sybase-ct symlink sysfs tcpd theora truetype unicode usb wifi wxwindows x86 xine xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev mouse keyboard synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="i810"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

Which option  I need to uncheck in order to compile my new kernel?

Thank you.

----------

## jseymour

Hello ONEEYEMAN,

I get the same errors with 2.6.29-gentoo source. See here:

https://forums.gentoo.org/viewtopic-t-778130.html

----------

## Peach

I think you'll have to switch to a more recent version of gcc (or even update it if you haven't done it yet) with "gcc-config"

latest stable is in 4.3 branch. strongly recommended to update it  :Smile: 

----------

## d2_racing

Hi, in fact you should upgrade to the latest stable GCC from portage.

Also, when you do this, you should change your CFLAGS to this :

```

CHOST="i686-pc-linux-gnu" 

CFLAGS="-Os -march=native -pipe" 

CXXFLAGS="-Os -march=native -pipe" 

```

----------

## ONEEYEMAN

Hi, guys,

As jseymor pointed out, it looks like switching to newer gcc won't help.

Besides, I am testing some other libraries, and I'd rather test with older compiler. Problem is I need my wireless to work so I won't to upgrade the kernel...

Thank you.

----------

## pappy_mcfae

Try starting with one of my kernel seeds. If you're unsure what to do, post your current .config, the results of lspci -n and cat /proc/cpuinfo as well as your /etc/fstab file, and I'll set you up with a functional kernel.

Blessed be!

Pappy

----------

## d2_racing

So you cannot plug an ethernet cable just to give you time to debug your box ?

----------

## MaximeG

Hi,

GCC is the culprit here.

You should update to the last version.

Regards,

Maxime

----------

## Hu

If you need to continue using gcc 4.1.x for some reason, you can upgrade to gcc 4.1.2.  Only 4.1.0 and 4.1.1 are known to mishandle the __weak directive.

----------

## d2_racing

But the best, should be to use the latest stable version of GCC and glibc.

----------

## ONEEYEMAN

Hi, ALL,

Upgrading gcc means recompilinh everything and on the networ-less laptop will be pain in the ....

So, I guess I'm stuck with old kernel/compiler for now.

Thank you.

----------

## Hu

 *ONEEYEMAN wrote:*   

> Upgrading gcc means recompilinh everything

 

Why do you say that?  As far as I know, no C programs require recompilation for the newer gcc version.  C++ programs might, if the ABI was changed.  However, if I recall correctly, gcc 4.1 and gcc 4.3 are ABI compatible for C++.

----------

## ONEEYEMAN

Hi,

As far as I can read in here, I will have to do "emerge -eav world", which means "everything.

Thank you.

----------

## ONEEYEMAN

Hi, ALL,

In terms of this error, I got another question: what is the latest gentoo-sources I can compile with my version gcc?

Thank you.

----------

## Hu

None of my systems have gone through an emerge --emptytree world after upgrading from gcc 4.1 to gcc 4.3, and I have experienced no discernable failures.  Even supposing that such were required, it is widely held that installing a patch release, such as changing from 4.1.1 to 4.1.2, does not require a full system rebuild.  I suggest that you upgrade gcc to 4.1.2.

----------

## Peach

 *Hu wrote:*   

> None of my systems have gone through an emerge --emptytree world after upgrading from gcc 4.1 to gcc 4.3, and I have experienced no discernable failures.  Even supposing that such were required, it is widely held that installing a patch release, such as changing from 4.1.1 to 4.1.2, does not require a full system rebuild.  I suggest that you upgrade gcc to 4.1.2.

 

I quote

upgrading from 4.1 to 4.3 is not a problem at all. they at least gived retro-compatibility. You should expect ABI breakeage in a major version upgrade most of all. 

I'd say: upgrade now gcc OR downgrade your kernel. that's all.

----------

## MaximeG

When changing of compiler, recompiling your already installed packages allow them to use the new features of it. But if you don't recompile, nothing bad is done.

Regards,

Maxime

----------

## ONEEYEMAN

Thank you for the reply, guys.

AFAIU, I will need to upgrade gcc to at least 4.1.2.

2 questions:

1. Will gcc-4.1.2 be ale to compile this kernel?

2. Any other package I will need to upgrade besides gcc?

Thank you.

P.S.: I just don't want to spend time re-compiling all system when I don't have an Internet connection....

----------

## pappy_mcfae

 *ONEEYEMAN wrote:*   

> Thank you for the reply, guys.
> 
> AFAIU, I will need to upgrade gcc to at least 4.1.2.
> 
> 2 questions:
> ...

 

I transitioned to 4.3.2 some time ago, but I have a feeling 4.1.2 will work out just fine.

 *Quote:*   

> 2. Any other package I will need to upgrade besides gcc?

 

No, but if you follow the Gentoo gcc upgrade guide, you will note it is suggested to emerge libtool and binutils as well as the gcc version.

 *Quote:*   

> Thank you.
> 
> P.S.: I just don't want to spend time re-compiling all system when I don't have an Internet connection....

 

Why not? Considering that your system was incredibly unstable, I'd think you'd want to see what stability is like. It's a drag and a PITA, but it's good for what ails your computer.

Blessed be!

Pappy

----------

## ONEEYEMAN

Hi, pappy,

My system is actually good working one, and it was stable when I built it.

It was a long time ago, but still....

So, all I will need is re-compile those 3. And then I will be able to build kernel and get my wireless card working!!!!!

Thank you.

----------

## pappy_mcfae

You should be able to get your kernel to compile...and together I'm sure we can get your wireless working as well.

Blessed be!

Pappy

----------

## d2_racing

 *pappy_mcfae wrote:*   

> You should be able to get your kernel to compile...and together I'm sure we can get your wireless working as well.
> 
> Blessed be!
> 
> Pappy

 

The only thing we need for your wireless is that :

```

# lspci

```

After that, we can help you to configure your kernel and all the stuff that you need to been able to use your wireless.

----------

