# [emerge] errore in compilazione: dev-libs/gmp-4.2.2

## elegos

Salve a tutti!

Come da titolo, quando eseguo questo comando:

```
emerge -e system
```

quando processa dev-libs/gmp-4.2.2 mi restituisce errore:

```
-- cut --

checking size of unsigned... 4

checking for unsigned long... yes

checking size of unsigned long... 4

checking for mp_limb_t... yes

checking size of mp_limb_t... 4

configure: error: Oops, mp_limb_t is 32 bits, but the assembler code

in this configuration expects 64 bits.

You appear to have set $CFLAGS, perhaps you also need to tell GMP the

intended ABI, see "ABI and ISA" in the manual.

-- cut --
```

Premetto che sto utilizzando una shell da Ubuntu in chroot sulla partizione di Gentoo (ma non dovrebbe essere un problema)...

Visto che nomina $CFLAGS, ecco il mio /etc/make.conf:

```
# These settings were set by the catalyst build script that automatically

# built this stage.

# Please consult /etc/make.conf.example for a more detailed example.

CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"

CXXFLAGS="$(CFLAGS)"

LDFLAGS="-Wl,--as-needed"

# WARNING: Changing your CHOST is not something that should be done lightly.

# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.

CHOST="x86_64-pc-linux-gnu"

MAKEOPTS="-j3"

GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://mirror.ing.unibo.it/gentoo/"

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

USE="X gtk gnome -qt3 -qt4 -kde dvd alsa cdr hal howl xvmc"

PORTDIR_OVERLAY="/usr/local/portage"

LINGUAS="it en"
```

Grazie  :Smile: 

----------

## Tigerwalk

pare un problema di architettura:

```
configure: error: Oops, mp_limb_t is 32 bits, but the assembler code

in this configuration expects 64 bits. 
```

Probabilmente sei su architettura 64 e stai compilando per 32 o viceversa!

----------

## elegos

inizialmente avevo il make.conf con "-march=i686", quindi sotto suggerimento nell'altro post mi sono impostato per bene il make.conf mettendoci "-march=prescott"...

Quindi mi hanno detto di dare un bel:

```
emerge -e system

emerge -e world
```

Come posso ovviare tale cosa?

Notare che sto lavorando su Ubuntu 32bit...

----------

## Tigerwalk

```
CHOST="x86_64-pc-linux-gnu"
```

Quindi devi compilare in chroot, da una distro con architettura 64 bit!

----------

## elegos

grazie  :Smile:  vuol dire che darò quel comando in gentoo  :Smile:  (sto facendo lavorare un programma che non può salvare l'attuale "stato", appena finisce vado su gentoo  :Smile: )

Potresti direttamente illustrarmi cosa fa allora chroot? So che non carica il kernel dell'OS, ma pensavo che GCC potesse compilare per 64bit su una qualsiasi macchina avente processore 64bit...

----------

## crisandbea

 *elegos wrote:*   

> grazie  vuol dire che darò quel comando in gentoo  (sto facendo lavorare un programma che non può salvare l'attuale "stato", appena finisce vado su gentoo )
> 
> Potresti direttamente illustrarmi cosa fa allora chroot? So che non carica il kernel dell'OS, ma pensavo che GCC potesse compilare per 64bit su una qualsiasi macchina avente processore 64bit...

 

per fare delle compilazioni su un sistema a 64bit, devi per forza fare chroot da un sistema a 64, non a 32 come nel tuo caso. ecco il perchè dell'errore.

ciao

----------

## elegos

 *crisandbea wrote:*   

>  *elegos wrote:*   grazie  vuol dire che darò quel comando in gentoo  (sto facendo lavorare un programma che non può salvare l'attuale "stato", appena finisce vado su gentoo )
> 
> Potresti direttamente illustrarmi cosa fa allora chroot? So che non carica il kernel dell'OS, ma pensavo che GCC potesse compilare per 64bit su una qualsiasi macchina avente processore 64bit... 
> 
> per fare delle compilazioni su un sistema a 64bit, devi per forza fare chroot da un sistema a 64, non a 32 come nel tuo caso. ecco il perchè dell'errore.
> ...

 

Allora credo proprio che sono un genio: dovrò reinstallarmi la gentoo (NUOOOOOO!! xD pazienza  :Razz:  )

Quindi riassumendo in CHROOT non si può fare da una macchina 32bit su gentoo (OS chrootato) 64bit:

1. compilare

2. caricare/visualizzare moduli kernel

3. altro?

----------

## Tigerwalk

credo che basti un emerge -e world da un chroot a 64 bit

----------

## elegos

sì ma io ho 'di base' solo una 32bit  :Razz: 

domanda (forse) stupida: devo compilare il kernel per farlo partire e lavorarci dentro, no?

Ok: come faccio a compilare il kernel in chroot per una 64bit se ho solo un linux 32bit?

----------

## Tigerwalk

 *elegos wrote:*   

> sì ma io ho 'di base' solo una 32bit 
> 
> domanda (forse) stupida: devo compilare il kernel per farlo partire e lavorarci dentro, no?
> 
> Ok: come faccio a compilare il kernel in chroot per una 64bit se ho solo un linux 32bit?

 

devi procurarti una live a 64 bit

----------

## elegos

OK! Ho rifatto tutto (in 64bit)... solo che ora mi dà errore il compilare il kernel...

```
(chroot) ubuntu / # genkernel --menuconfig all

* Gentoo Linux Genkernel; Version 3.4.9

* Running with options: --menuconfig all

* Linux Kernel 2.6.24-gentoo-r8 for x86_64...

* kernel: >> Running mrproper...

* config: Using config from /usr/share/genkernel/x86_64/kernel-config-2.6

*         Previous config backed up to .config.bak

*         >> Running oldconfig...

* kernel: >> Cleaning...

* config: >> Invoking menuconfig...

#

# configuration written to .config

#

*** End of Linux kernel configuration.

*** Execute 'make' to build the kernel or try 'make help'.

* ERROR: Failed to compile the "prepare" target...

* -- Grepping log... --

  SHIPPED scripts/kconfig/lex.zconf.c

  SHIPPED scripts/kconfig/zconf.hash.c

  HOSTCC  scripts/kconfig/zconf.tab.o

  HOSTLD  scripts/kconfig/conf

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

.config:160:warning: trying to assign nonexistent symbol REORDER

.config:181:warning: trying to assign nonexistent symbol ACPI_HOTKEY

.config:187:warning: trying to assign nonexistent symbol ACPI_IBM

.config:188:warning: trying to assign nonexistent symbol ACPI_IBM_DOCK

.config:221:warning: trying to assign nonexistent symbol X86_SPEEDSTEP_CENTRINO_ACPI

.config:287:warning: trying to assign nonexistent symbol NETDEBUG

.config:350:warning: trying to assign nonexistent symbol NET_DIVERT

.config:511:warning: trying to assign nonexistent symbol PARIDE_PARPORT

.config:592:warning: trying to assign nonexistent symbol BLK_DEV_IDEDMA_FORCED

.config:593:warning: trying to assign nonexistent symbol IDEDMA_PCI_AUTO

.config:594:warning: trying to assign nonexistent symbol IDEDMA_ONLYDISK

.config:623:warning: trying to assign nonexistent symbol IDEDMA_IVB

.config:624:warning: trying to assign nonexistent symbol IDEDMA_AUTO

.config:678:warning: trying to assign nonexistent symbol AIC79XX_ENABLE_RD_STRM

.config:687:warning: trying to assign nonexistent symbol SCSI_SATA

.config:688:warning: trying to assign nonexistent symbol SCSI_SATA_AHCI

.config:689:warning: trying to assign nonexistent symbol SCSI_SATA_SVW

.config:690:warning: trying to assign nonexistent symbol SCSI_ATA_PIIX

.config:691:warning: trying to assign nonexistent symbol SCSI_SATA_MV

.config:692:warning: trying to assign nonexistent symbol SCSI_SATA_NV

.config:693:warning: trying to assign nonexistent symbol SCSI_PDC_ADMA

.config:694:warning: trying to assign nonexistent symbol SCSI_SATA_QSTOR

.config:695:warning: trying to assign nonexistent symbol SCSI_SATA_PROMISE

.config:696:warning: trying to assign nonexistent symbol SCSI_SATA_SX4

.config:697:warning: trying to assign nonexistent symbol SCSI_SATA_SIL

.config:698:warning: trying to assign nonexistent symbol SCSI_SATA_SIL24

.config:699:warning: trying to assign nonexistent symbol SCSI_SATA_SIS

.config:700:warning: trying to assign nonexistent symbol SCSI_SATA_ULI

.config:701:warning: trying to assign nonexistent symbol SCSI_SATA_VIA

.config:702:warning: trying to assign nonexistent symbol SCSI_SATA_VITESSE

.config:703:warning: trying to assign nonexistent symbol SCSI_SATA_INTEL_COMBINED

.config:730:warning: trying to assign nonexistent symbol SCSI_QLA2XXX_EMBEDDED_FIRMWARE

.config:752:warning: trying to assign nonexistent symbol MD_RAID5

.config:754:warning: trying to assign nonexistent symbol MD_RAID6

.config:786:warning: trying to assign nonexistent symbol IEEE1394_OUI_DB

.config:787:warning: trying to assign nonexistent symbol IEEE1394_EXTRA_CONFIG_ROMS

.config:788:warning: trying to assign nonexistent symbol IEEE1394_CONFIG_ROM_IP1394

.config:789:warning: trying to assign nonexistent symbol IEEE1394_EXPORT_FULL_API

.config:886:warning: trying to assign nonexistent symbol DGRS

.config:954:warning: trying to assign nonexistent symbol NET_RADIO

.config:955:warning: trying to assign nonexistent symbol NET_WIRELESS_RTNETLINK

.config:977:warning: trying to assign nonexistent symbol IPW_QOS

.config:1014:warning: trying to assign nonexistent symbol NET_WIRELESS

.config:1037:warning: trying to assign nonexistent symbol SYNCLINK_SYNCPPP

.config:1054:warning: trying to assign nonexistent symbol DLCI_COUNT

.config:1164:warning: trying to assign nonexistent symbol INPUT_TSDEV

.config:1267:warning: trying to assign nonexistent symbol TIPAR

.config:1354:warning: trying to assign nonexistent symbol I2C_ISA

.config:1450:warning: symbol value 'm' invalid for VIDEO_V4L2

.config:1531:warning: trying to assign nonexistent symbol DVB

.config:1534:warning: trying to assign nonexistent symbol VIDEO_VIDEOBUF

.config:1536:warning: trying to assign nonexistent symbol VIDEO_BUF

.config:1550:warning: trying to assign nonexistent symbol FB_FIRMWARE_EDID

.config:1561:warning: trying to assign nonexistent symbol FB_VESA_STD

.config:1562:warning: trying to assign nonexistent symbol FB_VESA_TNG

.config:1603:warning: trying to assign nonexistent symbol BACKLIGHT_DEVICE

.config:1605:warning: trying to assign nonexistent symbol LCD_DEVICE

.config:1606:warning: trying to assign nonexistent symbol FB_SPLASH

.config:1611:warning: trying to assign nonexistent symbol SPEAKUP

.config:1612:warning: trying to assign nonexistent symbol SPEAKUP_ACNTSA

.config:1613:warning: trying to assign nonexistent symbol SPEAKUP_ACNTPC

.config:1614:warning: trying to assign nonexistent symbol SPEAKUP_APOLLO

.config:1615:warning: trying to assign nonexistent symbol SPEAKUP_AUDPTR

.config:1616:warning: trying to assign nonexistent symbol SPEAKUP_BNS

.config:1617:warning: trying to assign nonexistent symbol SPEAKUP_DECTLK

.config:1618:warning: trying to assign nonexistent symbol SPEAKUP_DECEXT

.config:1619:warning: trying to assign nonexistent symbol SPEAKUP_DECPC

.config:1620:warning: trying to assign nonexistent symbol SPEAKUP_DTLK

.config:1621:warning: trying to assign nonexistent symbol SPEAKUP_KEYPC

.config:1622:warning: trying to assign nonexistent symbol SPEAKUP_LTLK

.config:1623:warning: trying to assign nonexistent symbol SPEAKUP_SFTSYN

.config:1624:warning: trying to assign nonexistent symbol SPEAKUP_SPKOUT

.config:1625:warning: trying to assign nonexistent symbol SPEAKUP_TXPRT

.config:1630:warning: trying to assign nonexistent symbol SPEAKUP_DEFAULT

.config:1667:warning: trying to assign nonexistent symbol SND_AC97_BUS

.config:1756:warning: trying to assign nonexistent symbol USB_BANDWIDTH

.config:1769:warning: trying to assign nonexistent symbol USB_OHCI_BIG_ENDIAN

.config:1805:warning: trying to assign nonexistent symbol USB_HIDINPUT

.config:1818:warning: trying to assign nonexistent symbol USB_AIPTEK

.config:1819:warning: trying to assign nonexistent symbol USB_WACOM

.config:1820:warning: trying to assign nonexistent symbol USB_ACECAD

.config:1821:warning: trying to assign nonexistent symbol USB_KBTAB

.config:1822:warning: trying to assign nonexistent symbol USB_POWERMATE

.config:1823:warning: trying to assign nonexistent symbol USB_TOUCHSCREEN

.config:1824:warning: trying to assign nonexistent symbol USB_TOUCHSCREEN_EGALAX

.config:1825:warning: trying to assign nonexistent symbol USB_TOUCHSCREEN_PANJIT

.config:1826:warning: trying to assign nonexistent symbol USB_TOUCHSCREEN_3M

.config:1827:warning: trying to assign nonexistent symbol USB_TOUCHSCREEN_ITM

.config:1828:warning: trying to assign nonexistent symbol USB_YEALINK

.config:1829:warning: trying to assign nonexistent symbol USB_XPAD

.config:1830:warning: trying to assign nonexistent symbol USB_ATI_REMOTE

.config:1831:warning: trying to assign nonexistent symbol USB_ATI_REMOTE2

.config:1832:warning: trying to assign nonexistent symbol USB_KEYSPAN_REMOTE

.config:1833:warning: trying to assign nonexistent symbol USB_APPLETOUCH

.config:1871:warning: trying to assign nonexistent symbol USB_SERIAL_ANYDATA

.config:1967:warning: trying to assign nonexistent symbol IPATH_CORE

.config:1987:warning: symbol value 'm' invalid for RTC_INTF_SYSFS

.config:1988:warning: symbol value 'm' invalid for RTC_INTF_PROC

.config:1989:warning: symbol value 'm' invalid for RTC_INTF_DEV

.config:2036:warning: trying to assign nonexistent symbol XFS_EXPORT

.config:2060:warning: trying to assign nonexistent symbol ZISOFS_FS

.config:2085:warning: trying to assign nonexistent symbol RAMFS

.config:2103:warning: trying to assign nonexistent symbol SQUASHFS_VMALLOC

.config:2150:warning: trying to assign nonexistent symbol RXRPC

.config:2243:warning: trying to assign nonexistent symbol UNWIND_INFO

--

* Bus options (PCI etc.)

*

PCI support (PCI) [Y/n/?] y

  Support mmconfig PCI config space access (PCI_MMCONFIG) [Y/n] y

Support for DMA Remapping Devices (EXPERIMENTAL) (DMAR) [N/y/?] (NEW) PCI Express support (PCIEPORTBUS) [Y/n/?] y

  Root Port Advanced Error Reporting support (PCIEAER) [Y/n/?] (NEW) Message Signaled Interrupts (MSI and MSI-X) (PCI_MSI) [Y/n/?] y

--

SCSI media changer support (CHR_DEV_SCH) [M/n/y/?] m

*

* Some SCSI devices (e.g. CD jukebox) support multiple LUNs

*

Probe all LUNs on each SCSI device (SCSI_MULTI_LUN) [N/y/?] n

Verbose SCSI error reporting (kernel size +=12K) (SCSI_CONSTANTS) [N/y/?] n

--

  QLogic InfiniPath Driver (INFINIBAND_IPATH) [M/n/?] m

  Ammasso 1100 HCA support (INFINIBAND_AMSO1100) [N/m/?] (NEW)   Mellanox ConnectX HCA support (MLX4_INFINIBAND) [N/m/?] (NEW)   IP-over-InfiniBand (INFINIBAND_IPOIB) [M/n/?] m

    IP-over-InfiniBand Connected Mode support (INFINIBAND_IPOIB_CM) [N/y/?] (NEW)     IP-over-InfiniBand debugging (INFINIBAND_IPOIB_DEBUG) [N/y/?] n

  InfiniBand SCSI RDMA Protocol (INFINIBAND_SRP) [M/n/?] m

  iSCSI Extensions for RDMA (iSER) (INFINIBAND_ISER) [N/m/?] (NEW) *

* EDAC - error detection and reporting (EXPERIMENTAL)

*

EDAC - error detection and reporting (EXPERIMENTAL) (EDAC) [N/y/?] n

--

GFS2 file system support (GFS2_FS) [N/m/y/?] (NEW) OCFS2 file system support (OCFS2_FS) [N/m/y/?] n

Minix fs support (MINIX_FS) [M/n/y/?] m

ROM file system support (ROMFS_FS) [M/n/y/?] m

Inotify file change notification support (INOTIFY) [Y/n/?] y

  Inotify support for userspace (INOTIFY_USER) [Y/n/?] (NEW) Quota support (QUOTA) [Y/n/?] y

  Report quota messages through netlink interface (QUOTA_NETLINK_INTERFACE) [N/y/?] (NEW)   Print quota warnings to console (OBSOLETE) (PRINT_QUOTA_WARNING) [Y/n/?] (NEW)   Old quota format support (QFMT_V1) [M/n/y/?] m

--

  UPD     include/linux/version.h

  CHK     include/linux/utsrelease.h

  UPD     include/linux/utsrelease.h

  SYMLINK include/asm -> include/asm-x86

  CC      arch/x86/kernel/asm-offsets.s

arch/x86/kernel/asm-offsets.c:1: error: code model 'kernel' not supported in the 32 bit mode

arch/x86/kernel/asm-offsets.c:1: sorry, unimplemented: 64-bit mode not compiled in

make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1

make: *** [prepare0] Error 2

* Gentoo Linux Genkernel; Version 3.4.9

* Running with options: --menuconfig all

* ERROR: Failed to compile the "prepare" target...

* -- End log... --

* Please consult /var/log/genkernel.log for more information and any

* errors that were reported above.

* Report any genkernel bugs to bugs.gentoo.org and

* assign your bug to genkernel@gentoo.org. Please include

* as much information as you can in your bug report; attaching

* /var/log/genkernel.log so that your issue can be dealt with effectively.

* 

* Please do *not* report compilation failures as genkernel bugs!
```

Bene... ho fatto esattamente quel che avevo fatto in precedenza (32bit)...

da quanto ho capito l'errore è qui:

```
arch/x86/kernel/asm-offsets.c:1: error: code model 'kernel' not supported in the 32 bit mode

arch/x86/kernel/asm-offsets.c:1: sorry, unimplemented: 64-bit mode not compiled in
```

Ma perché utilizza x86 se dovrebbe essere x86_64? (ma forse è giusto così...)

make.conf:

```
# These settings were set by the catalyst build script that automatically

# built this stage.

# Please consult /etc/make.conf.example for a more detailed example.

CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"

CXXFLAGS="$(CFLAGS)"

LDFLAGS="-Wl,--as-needed"

# WARNING: Changing your CHOST is not something that should be done lightly.

# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.

CHOST="x86_64-pc-linux-gnu"

MAKEOPTS="-j3"

GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://mirror.ing.unibo.it/gentoo/"

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

USE="X gtk gnome -qt3 -qt4 -kde dvd alsa cdr hal howl xvmc"

PORTDIR_OVERLAY="/usr/local/portage"

LINGUAS="it en"
```

ovviamente ho installato lo stage3 AMD64... Processore Intel Txxxx (controllato sulla guida 'prescott' dovrebbe essere giusto)

Sapete dirmi come risolvere? Ora sono in chroot da una live 64bit Ubuntu...

----------

## Tigerwalk

ho trovato questo: https://bugs.gentoo.org/show_bug.cgi?ctype=xml&id=120526

prova a compilare una versione diversa di genkernel (anche precedente) dando

emerge -av =genkernel-versione.che.vuoi

----------

## elegos

sembrava che avessi un miscuglio di file x86 e x86_64 (?!?) nonostante avessi cancellato i file sul drive... ora che ho formattato e rifatto non mi si è ripresentato lo stesso errore...

però ora la compilazione di altri sorgenti mi dice questo O.ò (nello specifico dev-util/pkgconfig-0.22)

```
configure: error: C compiler cannot create executables
```

Guardando su internet mi è parso di capire che era per colpa delle glibc... beh sta notte ho fatto compilare le glibc, ma il risultato non cambia :S

idee?

EDIT:

config.log, vicino all'errore:

```
configure:2933: $? = 0

configure:2940: x86_64-pc-linux-gnu-gcc -v >&5

Using built-in specs.

Target: x86_64-pc-linux-gnu

Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/x86_64-pc$

Thread model: posix

gcc version 4.1.2 (Gentoo 4.1.2 p1.1)

configure:2943: $? = 0

configure:2950: x86_64-pc-linux-gnu-gcc -V >&5

x86_64-pc-linux-gnu-gcc: '-V' option must have argument

configure:2953: $? = 1

configure:2976: checking for C compiler default output file name

configure:3003: x86_64-pc-linux-gnu-gcc -O2 -march=prescott -pipe -fomit-frame-pointer  -Wl,--as-needed conftest.c  >&5

conftest.c:1: error: CPU you selected does not support x86-64 instruction set

conftest.c:1: error: CPU you selected does not support x86-64 instruction set

configure:3006: $? = 1

configure:3044: result:

configure: failed program was:

| /* confdefs.h.  */

| #define PACKAGE_NAME ""

| #define PACKAGE_TARNAME ""

| #define PACKAGE_VERSION ""

| #define PACKAGE_STRING ""

| #define PACKAGE_BUGREPORT ""

| #define PACKAGE "pkg-config"

| #define VERSION "0.22"

| /* end confdefs.h.  */

|

| int

| main ()

| {

|

|   ;

|   return 0;

| }

configure:3051: error: C compiler cannot create executables

See `config.log' for more details.
```

----------

## djinnZ

```
configure: error: C compiler cannot create executables
```

spesso vuol dire banalmente che hai scritto male una opzione delle CFLAGS in make.conf. Verifica un attimo che non hai scritto -02 o -march=qualcosa sbagliato (è questo il problema a 64 bit è -march=nocona sugli intel).

----------

