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これは、コンパイラに警告をエラーとして処理するように指示するコンパイラフラグが原因で発生します。実は普通はいいアイデアですね主に頻繁に触れるから―「しかし、それはちょうどいくつかの警告でコンパイルされました。」方法)。

その他の質問:

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

実際にはリンカーのエラーです。コンパイルはある程度うまくいきますが、コードが参照するいくつかのシンボルを提供する外部ライブラリを提供していません。これは通常、ヘッダーファイルを正しく設定し、リンカーにライブラリ#includeに実際にリンクするように指示することを忘れた場合に発生します(通常オプション)。-l

おすすめ記事