cc1: FreeBSD 버전 8.2를 컴파일할 때 경고가 오류로 처리됩니다.

cc1: FreeBSD 버전 8.2를 컴파일할 때 경고가 오류로 처리됩니다.

FreeBsd 8.2 RELEASE 커널을 컴파일하려고 합니다.

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

커널 빌드

# pwd
/usr/src
# make buildkernel

...이 오류가 발생할 때까지 컴파일됩니다...

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.

이 오류 메시지를 평가하고 수정하는 방법을 잘 모르겠습니다.

추천하는 방향이 있나요?

다른 가상 머신에서 업데이트해 보세요

다음과 유사한 오류 메시지를 받았습니다.

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.

답변1

두 경우 모두 기본적으로 빌드 중단 경고가 아닙니다.

커널 컴파일의 경우:

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

컴파일러는 코드가 존재하지 않는 항목에 액세스하려고 한다고 알려줍니다. 원인은 다양할 수 있지만 일반적으로 코드가 손상되었음을 나타냅니다. 어쩌면 최신/이전 내부 커널 API에 의존하는 모듈을 컴파일하려고 할 수도 있습니다(즉, 커널의 나머지 부분과 다른 구조체 정의를 사용함).

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

이는 일반적으로 프로그래밍 오류(예: 예상과 다른 항목이 실제로 인수로 전달됨)이거나 캐스트 연산자가 누락되었기 때문입니다.

cc1: warnings being treated as errors

-Werror이는 컴파일러에게 경고를 오류로 처리하도록 지시하는 컴파일러 플래그 로 인해 발생합니다 . 사실 보통 좋은 생각이에요TM ( 주로 자주 접하기 때문에-"그러나 그것은 단지 몇 가지 경고와 함께 컴파일되었습니다."방법).

다른 질문:

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

실제로 링커의 오류입니다. 컴파일은 어느 정도 잘 진행되지만 코드에서 참조하는 일부 기호를 제공하는 외부 라이브러리를 제공하지 않았습니다. 이는 일반적 으로 헤더 파일을 올바르게 설정한 #include다음 링커에게 실제로 라이브러리에 대해 링크하도록 지시하는 것을 잊어버린 경우에 발생합니다(보통 옵션).-l

관련 정보