cc1: avisos sendo tratados como erros ao compilar o FreeBSD 8.2 Release

0

Eu estou tentando compilar o kernel do FreeBsd 8.2 RELEASE

# uname -a
FreeBSD 8.2-RELEASE FreeBSD 8.2-RELEASE #2: Sun May 18 00:07:10 PDT 2014

Construa o kernel

# pwd
/usr/src
# make buildkernel

... compila até eu receber este erro ...

MAKE=make sh /usr/src/sys/conf/newvers.sh GENERIC
cc -c -O -pipe  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000  -mno-align-long-strings -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -Werror  vers.c
linking kernel.debug
   text    data     bss     dec     hex filename
9336435  915392  672984 10924811     a6b30b kernel.debug
objcopy --only-keep-debug kernel.debug kernel.symbols
objcopy --strip-debug --add-gnu-debuglink=kernel.symbols kernel.debug kernel
cd /usr/src/sys/modules; MAKEOBJDIRPREFIX=/usr/obj/usr/src/sys/GENERIC/modules KMODDIR=/boot/kernel MODULES_OVERRIDE="usb/run" DEBUG_FLAGS="-g" MACHINE=i386 KERNBUILDDIR="/usr/obj/usr/src/sys/GENERIC" SYSDIR="/usr/src/sys" make  all
===> usb/run (all)
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/sys/GENERIC/opt_global.h -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -I/usr/obj/usr/src/sys/GENERIC -mno-align-long-strings -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c /usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:150: error: 'USB_PRODUCT_CISCOLINKSYS_AE1000' undeclared here (not in a function)
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_vap_delete':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:861: error: 'struct run_vap' has no member named 'beacon_mbuf'
cc1: warnings being treated as errors
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:861: warning: passing argument 1 of 'm_freem' from incompatible pointer type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:862: error: 'struct run_vap' has no member named 'beacon_mbuf'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:862: warning: statement with no effect
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_newstate':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:1809: error: 'struct run_vap' has no member named 'beacon_mbuf'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:1809: warning: passing argument 1 of 'm_freem' from incompatible pointer type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:1810: error: 'struct run_vap' has no member named 'beacon_mbuf'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:1810: warning: statement with no effect
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_key_set':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2106: error: 'struct run_softc' has no member named 'cmdq_key_del'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2106: warning: passing argument 1 of 'atomic_load_acq_int' from incompatible pointer type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_key_delete_cb':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2166: error: 'struct run_softc' has no member named 'cmdq_key_del'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2166: warning: passing argument 1 of 'atomic_clear_barr_int' from incompatible pointer type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_key_delete':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2181: error: 'struct run_softc' has no member named 'cmdq_key_del'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2181: warning: passing argument 1 of 'atomic_set_barr_int' from incompatible pointer type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_drain_fifo':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2284: error: 'struct run_softc' has no member named 'wcid_stats'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2284: warning: assignment from incompatible pointer type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2285: error: 'RUN_TXCNT' undeclared (first use in this function)
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2285: error: (Each undeclared identifier is reported only once
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2285: error: for each function it appears in.)
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2285: error: array subscript is not an integer
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2285: error: lvalue required as increment operand
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2285: warning: statement with no effect
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2287: error: 'RUN_SUCCESS' undeclared (first use in this function)
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2287: error: array subscript is not an integer
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2287: error: lvalue required as increment operand
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2287: warning: statement with no effect
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2298: error: array subscript is not an integer
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2298: warning: statement with no effect
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2299: error: 'RUN_RETRY' undeclared (first use in this function)
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2299: error: array subscript is not an integer
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2299: warning: statement with no effect
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_iter_func':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2315: error: array type has incomplete element type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2324: warning: cast discards qualifiers from pointer target type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2325: warning: passing argument 4 of 'run_read_region_1' makes integer from pointer without a cast
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2330: error: 'struct usb_device_id' has no member named 'error'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2330: error: request for member 'fail' in something not a structure or union
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2330: warning: cast from pointer to integer of different size
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2332: error: 'struct usb_device_id' has no member named 'tx'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2332: error: request for member 'retry' in something not a structure or union
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2332: warning: cast from pointer to integer of different size
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2333: error: 'struct usb_device_id' has no member named 'tx'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2333: error: request for member 'success' in something not a structure or union
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2333: warning: cast from pointer to integer of different size
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2334: error: 'struct usb_device_id' has no member named 'error'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2334: error: request for member 'fail' in something not a structure or union
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2334: warning: cast from pointer to integer of different size
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2336: error: 'struct usb_device_id' has no member named 'error'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2336: error: request for member 'fail' in something not a structure or union
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2336: warning: cast from pointer to integer of different size
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2339: error: 'struct run_softc' has no member named 'wcid_stats'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2339: warning: assignment from incompatible pointer type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2341: error: 'struct run_softc' has no member named 'wcid_stats'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2341: warning: comparison of distinct pointer types lacks a cast
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2342: error: 'struct run_softc' has no member named 'wcid_stats'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2342: warning: comparison of distinct pointer types lacks a cast
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2345: error: 'RUN_TXCNT' undeclared (first use in this function)
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2345: error: array subscript is not an integer
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2345: warning: assignment makes integer from pointer without a cast
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2346: error: 'RUN_SUCCESS' undeclared (first use in this function)
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2346: error: array subscript is not an integer
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2346: warning: assignment makes integer from pointer without a cast
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2347: error: 'RUN_RETRY' undeclared (first use in this function)
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2347: error: array subscript is not an integer
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2347: warning: assignment makes integer from pointer without a cast
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2315: warning: unused variable 'sta'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_newassoc_cb':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2378: error: 'struct run_softc' has no member named 'wcid_stats'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2378: error: 'struct run_softc' has no member named 'wcid_stats'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:2378: warning: passing argument 1 of 'memset' discards qualifiers from pointer target type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_update_beacon':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:3990: error: 'struct run_vap' has no member named 'beacon_mbuf'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:3990: warning: passing argument 3 of 'ieee80211_beacon_update' from incompatible pointer type
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c: In function 'run_update_beacon_cb':
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:4019: error: 'struct run_vap' has no member named 'beacon_mbuf'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:4020: error: 'struct run_vap' has no member named 'beacon_mbuf'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:4021: warning: statement with no effect
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:4022: error: 'struct run_vap' has no member named 'beacon_mbuf'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:4025: error: 'struct run_vap' has no member named 'beacon_mbuf'
/usr/src/sys/modules/usb/run/../../../dev/usb/wlan/if_run.c:4025: warning: assignment from incompatible pointer type
*** Error code 1

Stop in /usr/src/sys/modules/usb/run.
*** Error code 1

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

Stop in /usr/obj/usr/src/sys/GENERIC.
*** Error code 1

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

Stop in /usr/src.

Não sei como avaliar essa mensagem de erro e corrigi-la.

Alguma direção recomendada?

ATUALIZAÇÃO TENTADA EM OUTRA VM

Recebemos uma mensagem de erro semelhante

cc -static -o rescue rescue.o cat.lo chflags.lo chio.lo chmod.lo cp.lo date.lo dd.lo df.lo echo.lo ed.lo expr.lo getfacl.lo hostname.lo kenv.lo kill.lo ln.lo ls.lo mkdir.lo mv.lo pkill.lo ps.lo pwd.lo realpath.lo rm.lo rmdir.lo setfacl.lo sh.lo stty.lo sync.lo test.lo rcp.lo csh.lo atacontrol.lo badsect.lo camcontrol.lo ccdconfig.lo clri.lo devfs.lo dmesg.lo dump.lo dumpfs.lo dumpon.lo fsck.lo fsck_ffs.lo fsck_msdosfs.lo fsdb.lo fsirand.lo gbde.lo geom.lo ifconfig.lo init.lo kldconfig.lo kldload.lo kldstat.lo kldunload.lo ldconfig.lo md5.lo mdconfig.lo mdmfs.lo mknod.lo mount.lo mount_cd9660.lo mount_msdosfs.lo mount_nfs.lo mount_ntfs.lo mount_nullfs.lo mount_udf.lo mount_unionfs.lo newfs.lo newfs_msdos.lo nos-tun.lo ping.lo reboot.lo restore.lo rcorder.lo route.lo routed.lo rtquery.lo rtsol.lo savecore.lo spppcontrol.lo swapon.lo sysctl.lo tunefs.lo umount.lo atmconfig.lo ping6.lo ipf.lo zfs.lo zpool.lo bsdlabel.lo sconfig.lo fdisk.lo dhclient.lo head.lo mt.lo sed.lo tail.lo tee.lo gzip.lo bzip2.lo xz.lo tar.lo vi.lo id.lo chroot.lo chown.lo /usr/src/rescue/rescue/../librescue/exec.o /usr/src/rescue/rescue/../librescue/getusershell.o /usr/src/rescue/rescue/../librescue/login_class.o /usr/src/rescue/rescue/../librescue/popen.o /usr/src/rescue/rescue/../librescue/rcmdsh.o /usr/src/rescue/rescue/../librescue/sysctl.o /usr/src/rescue/rescue/../librescue/system.o -lcrypt -ledit -lkvm -ll -ltermcap -lutil -lalias -lcam -lcurses -ldevstat -lipsec -lipx -lzfs -lnvpair -luutil -lavl -lgeom -lbsdxml -ljail -lkiconv -lmd -lreadline -lsbuf -lufs -lz -lbz2 -llzma -larchive -lcrypto -lm
csh.lo(.text+0xdba6): In function 'nlsclose':
: undefined reference to 'dl_iconv_close'
csh.lo(.text+0xdd21): In function 'nlsinit':
: undefined reference to 'dl_iconv_open'
csh.lo(.text+0xde1c): In function 'iconv_catgets':
: undefined reference to 'dl_iconv'
*** Error code 1

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

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

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

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

Stop in /usr/src.
    
por zabumba 01.12.2014 / 13:49

1 resposta

2

Em ambos os casos, esses não são principalmente avisos que quebram a compilação.

Para a compilação do kernel:

error: 'struct run_vap' has no member named 'beacon_mbuf'

o compilador informa que o código está tentando acessar algo que não está lá. Isso pode ter muitas razões, mas geralmente sugere que o código está quebrado. Talvez você esteja tentando compilar um módulo que dependa de uma API interna mais nova / mais antiga do kernel (ou seja, está usando outra definição de estruturas do que o resto do kernel).

warning: passing argument 1 of 'm_freem' from incompatible pointer type

é frequentemente um erro de programação (ou seja, de fato, passar algo mais como argumento do que o esperado) ou um operador de elenco ausente.

cc1: warnings being treated as errors

é causado por -Werror nos sinalizadores do compilador, que informa ao compilador para tratar os avisos como erros. O que geralmente é uma boa ideia TM , na verdade (principalmente por causa das muitas vezes encontradas - "Mas compila, há apenas algumas advertências" atitude).

Para o outro problema:

csh.lo(.text+0xdba6): In function 'nlsclose':
: undefined reference to 'dl_iconv_close'

é na verdade um erro do link - a compilação foi (mais ou menos) bem, mas você não está fornecendo bibliotecas externas que fornecem alguns símbolos referenciados pelo código. Isso geralmente acontece quando você corretamente #include arquivos de cabeçalho e, em seguida, esquece de dizer linker para realmente vincular contra essa biblioteca (geralmente a opção -l ).

    
por 01.12.2014 / 15:33