Date: Tue, 3 Mar 2020 10:52:37 +0300 From: Pavel Timofeev <timp87@gmail.com> To: freebsd-stable stable <freebsd-stable@freebsd.org> Subject: Building 12-STABLE for MIPS using GCC 9.2 Message-ID: <CAAoTqfv8sP8AOumyYd_mG_xPb90p9rHbQLPVBpn0Z5pCXBzHPg@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi, I've tried to build 12-stable r358547 for MIPS using mips-gcc9-9.2.0 (gcc 6.5.0 is available but out of date and probably will be removed from ports tree in some future). 12-stable can't be compiled with such gcc version right now, so here is a list of errors and patches taken from HEAD that helped me to do build it. This is in case someone wants to do the same at least: - The first build error was: jemalloc_malloc_io.c: In function '__je_malloc_vsnprintf': jemalloc_malloc_io.c:383:2: error: case label value exceeds maximum value for type [-Werror] 383 | case '?' | 0x80: \ | ^~~~ jemalloc_malloc_io.c:595:5: note: in expansion of macro 'GET_ARG_NUMERIC' 595 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ jemalloc_malloc_io.c:401:2: error: case label value exceeds maximum value for type [-Werror] 401 | case 'j' | 0x80: \ | ^~~~ jemalloc_malloc_io.c:595:5: note: in expansion of macro 'GET_ARG_NUMERIC' 595 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ jemalloc_malloc_io.c:389:2: error: case label value exceeds maximum value for type [-Werror] 389 | case 'l' | 0x80: \ | ^~~~ jemalloc_malloc_io.c:595:5: note: in expansion of macro 'GET_ARG_NUMERIC' 595 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ jemalloc_malloc_io.c:395:2: error: case label value exceeds maximum value for type [-Werror] 395 | case 'q' | 0x80: \ | ^~~~ jemalloc_malloc_io.c:595:5: note: in expansion of macro 'GET_ARG_NUMERIC' 595 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ jemalloc_malloc_io.c:410:2: error: case label value exceeds maximum value for type [-Werror] 410 | case 'z' | 0x80: \ | ^~~~ jemalloc_malloc_io.c:595:5: note: in expansion of macro 'GET_ARG_NUMERIC' 595 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ cc1: all warnings being treated as errors --- jemalloc_malloc_io.o --- *** [jemalloc_malloc_io.o] Error code 1 make[4]: stopped in /usr/home/pavel.timofeev/mips/12/lib/libc 1 error Fix from HEAD https://svnweb.freebsd.org/base?view=revision&revision=355975 - The second error was: ===> lib/libalias/modules/nbt (all) /usr/home/pavel.timofeev/mips/12/sys/netinet/libalias/alias_nbt.c: In function 'protohandler2out': /usr/home/pavel.timofeev/mips/12/sys/netinet/libalias/alias_nbt.c:127:48: error: taking address of packed member of 'struct ip' may result in an unaligned pointer value [-Werror=address-of-packed-member] 127 | return (AliasHandleUdpNbtNS(la, pip, ah->lnk, &pip->ip_src, ah->sport, | ^~~~~~~~~~~~ cc1: all warnings being treated as errors --- alias_nbt.o --- *** [alias_nbt.o] Error code 1 make[7]: stopped in /usr/home/pavel.timofeev/mips/12/lib/libalias/modules/nbt 1 error make[7]: stopped in /usr/home/pavel.timofeev/mips/12/lib/libalias/modules/nbt --- all_subdir_lib/libalias/modules/nbt --- *** [all_subdir_lib/libalias/modules/nbt] Error code 2 make[6]: stopped in /usr/home/pavel.timofeev/mips/12/lib/libalias/modules 1 error make[6]: stopped in /usr/home/pavel.timofeev/mips/12/lib/libalias/modules --- all_subdir_lib/libalias/modules --- *** [all_subdir_lib/libalias/modules] Error code 2 make[5]: stopped in /usr/home/pavel.timofeev/mips/12/lib/libalias 1 error make[5]: stopped in /usr/home/pavel.timofeev/mips/12/lib/libalias --- all_subdir_lib/libalias --- *** [all_subdir_lib/libalias] Error code 2 make[4]: stopped in /usr/home/pavel.timofeev/mips/12/lib 1 error make[4]: stopped in /usr/home/pavel.timofeev/mips/12/lib --- lib__L --- *** [lib__L] Error code 2 make[3]: stopped in /usr/home/pavel.timofeev/mips/12 A failure has been detected in another branch of the parallel make make[4]: stopped in /usr/home/pavel.timofeev/mips/12/sbin/ipf/libipf --- sbin/ipf/libipf__L --- *** [sbin/ipf/libipf__L] Error code 2 make[3]: stopped in /usr/home/pavel.timofeev/mips/12 2 errors Applying this commit from HEAD helped https://svnweb.freebsd.org/base?view=revision&revision=355971 - Third error was: ===> lib/libdevdctl (all) In file included from /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/consumer.cc:55: /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/event.h: In member function 'DevdCtl::Guid DevdCtl::ZfsEvent::PoolGUID() const': /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/event.h:413:20: error: implicitly-declared 'constexpr DevdCtl::Guid::Guid(const DevdCtl::Guid&)' is deprecated [-Werror=deprecated-copy] 413 | return (m_poolGUID); | ^ In file included from /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/consumer.cc:54: /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/guid.h:114:1: note: because 'DevdCtl::Guid' has user-provided 'DevdCtl::Guid& DevdCtl::Guid::operator=(const DevdCtl::Guid&)' 114 | Guid::operator=(const Guid &rhs) | ^~~~ In file included from /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/consumer.cc:55: /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/event.h: In member function 'DevdCtl::Guid DevdCtl::ZfsEvent::VdevGUID() const': /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/event.h:419:20: error: implicitly-declared 'constexpr DevdCtl::Guid::Guid(const DevdCtl::Guid&)' is deprecated [-Werror=deprecated-copy] 419 | return (m_vdevGUID); | ^ In file included from /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/consumer.cc:54: /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/guid.h:114:1: note: because 'DevdCtl::Guid' has user-provided 'DevdCtl::Guid& DevdCtl::Guid::operator=(const DevdCtl::Guid&)' 114 | Guid::operator=(const Guid &rhs) | ^~~~ In file included from /usr/home/pavel.timofeev/mips/obj/mips_ap/usr/home/pavel.timofeev/mips/12/mips.mips/tmp/usr/include/c++/v1/memory:667, from /usr/home/pavel.timofeev/mips/obj/mips_ap/usr/home/pavel.timofeev/mips/12/mips.mips/tmp/usr/include/c++/v1/list:183, from /usr/home/pavel.timofeev/mips/12/lib/libdevdctl/consumer.cc:50: /usr/home/pavel.timofeev/mips/obj/mips_ap/usr/home/pavel.timofeev/mips/12/mips.mips/tmp/usr/include/c++/v1/atomic: At global scope: /usr/home/pavel.timofeev/mips/obj/mips_ap/usr/home/pavel.timofeev/mips/12/mips.mips/tmp/usr/include/c++/v1/atomic:726:6: warning: always_inline function might not be inlinable [-Wattributes] 726 | void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val, | ^~~~~~~~~~~~~~~~~~ /usr/home/pavel.timofeev/mips/obj/mips_ap/usr/home/pavel.timofeev/mips/12/mips.mips/tmp/usr/include/c++/v1/atomic:718:6: warning: always_inline function might not be inlinable [-Wattributes] 718 | void __cxx_atomic_store(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val, | ^~~~~~~~~~~~~~~~~~ /usr/home/pavel.timofeev/mips/obj/mips_ap/usr/home/pavel.timofeev/mips/12/mips.mips/tmp/usr/include/c++/v1/atomic:763:5: warning: always_inline function might not be inlinable [-Wattributes] 763 | _Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp>* __a, _Tp __value, | ^~~~~~~~~~~~~~~~~~~~~ /usr/home/pavel.timofeev/mips/obj/mips_ap/usr/home/pavel.timofeev/mips/12/mips.mips/tmp/usr/include/c++/v1/atomic:753:5: warning: always_inline function might not be inlinable [-Wattributes] 753 | _Tp __cxx_atomic_exchange(volatile __cxx_atomic_base_impl<_Tp>* __a, | ^~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors --- consumer.o --- *** [consumer.o] Error code 1 make[5]: stopped in /usr/home/pavel.timofeev/mips/12/lib/libdevdctl 1 error make[5]: stopped in /usr/home/pavel.timofeev/mips/12/lib/libdevdctl --- all_subdir_lib/libdevdctl --- *** [all_subdir_lib/libdevdctl] Error code 2 The fix is from HEAD https://svnweb.freebsd.org/base?view=revision&revision=355974 - Fourth error was: /usr/home/pavel.timofeev/mips/12/sbin/camcontrol/camcontrol.c: In function 'ataidentify': /usr/home/pavel.timofeev/mips/12/sbin/camcontrol/camcontrol.c:2377:45: error: converting a packed 'struct ata_params' pointer (alignment 1) to a 'uint16_t' {aka 'short unsigned int'} pointer (alignment 2) may re sult in an unaligned pointer value [-Werror=address-of-packed-member] 2377 | dump_data((void*)ident_buf, sizeof(struct ata_params)); | ^~~~~~~~~~ In file included from /usr/home/pavel.timofeev/mips/12/sys/cam/ata/ata_all.h:34, from /usr/home/pavel.timofeev/mips/12/sys/cam/cam_ccb.h:45, from /usr/home/pavel.timofeev/mips/12/sbin/camcontrol/camcontrol.c:56: /usr/home/pavel.timofeev/mips/12/sys/sys/ata.h:37:8: note: defined here 37 | struct ata_params { | ^~~~~~~~~~ /usr/home/pavel.timofeev/mips/12/sbin/camcontrol/camcontrol.c: In function 'atasecurity_notify': /usr/home/pavel.timofeev/mips/12/sbin/camcontrol/camcontrol.c:2486:38: warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsi zeof-pointer-memaccess] 2486 | strncpy(pass, pwd->password, sizeof(pwd->password)); | ^ cc1: all warnings being treated as errors --- camcontrol.o --- *** [camcontrol.o] Error code 1 make[6]: stopped in /usr/home/pavel.timofeev/mips/12/sbin/camcontrol 1 error make[6]: stopped in /usr/home/pavel.timofeev/mips/12/sbin/camcontrol --- camcontrol_make --- *** [camcontrol_make] Error code 2 Fix from HEAD https://svnweb.freebsd.org/base?view=revision&revision=355972 - Fifth error: ===> usr.sbin/pw (all) [35/1784] /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw.c:30:19: warning: 'rcsid' defined but not used [-Wunused-const-variable=] 30 | static const char rcsid[] = | ^~~~~ /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw_conf.c:30:19: warning: 'rcsid' defined but not used [-Wunused-const-variable=] 30 | static const char rcsid[] = | ^~~~~ /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw_conf.c: In function 'write_userconfig': /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw_conf.c:420:38: warning: '/pw.conf' directive output may be truncated writing 8 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] 420 | snprintf(cfgfile, sizeof(cfgfile), "%s/" _PW_CONF, | ^~~~~ /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw_conf.c:420:41: note: format string is defined here 420 | snprintf(cfgfile, sizeof(cfgfile), "%s/" _PW_CONF, /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw_conf.c:420:3: note: 'snprintf' output between 9 and 1032 bytes into a destination of size 1024 420 | snprintf(cfgfile, sizeof(cfgfile), "%s/" _PW_CONF, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 421 | conf.etcpath); | ~~~~~~~~~~~~~ /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw_user.c: In function 'print_user': /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw_user.c:590:2: error: this 'if' clause does not guard... [-Werror=misleading-indentation] 590 | if (pwd->pw_expire > (time_t)0 && (tptr = localtime(&pwd->pw_expire)) != NULL) | ^~ /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw_user.c:592:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' 592 | if (pwd->pw_change > (time_t)0 && (tptr = localtime(&pwd->pw_change)) != NULL) | ^~ At top level: /usr/home/pavel.timofeev/mips/12/usr.sbin/pw/pw_user.c:31:19: warning: 'rcsid' defined but not used [-Wunused-const-variable=] 31 | static const char rcsid[] = | ^~~~~ /usr/home/pavel.timofeev/mips/12/contrib/bmake/dir.c: In function 'Dir_FindHereOrAbove': /usr/home/pavel.timofeev/mips/12/contrib/bmake/dir.c:1455:36: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=] 1455 | snprintf(try, sizeof(try), "%s/%s", dirbase, search_path); | ^ /usr/home/pavel.timofeev/mips/12/contrib/bmake/dir.c:1455:3: note: 'snprintf' output 2 or more bytes (assuming 1026) into a destination of size 1025 1455 | snprintf(try, sizeof(try), "%s/%s", dirbase, search_path); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors --- pw_user.o --- *** [pw_user.o] Error code 1 make[4]: stopped in /usr/home/pavel.timofeev/mips/12/usr.sbin/pw 1 error The fix from HEAD https://svnweb.freebsd.org/base?view=revision&revision=348282 - Sixth error /usr/home/pavel.timofeev/mips/12/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c: In function 'ar5210GetTxDescLinkPtr': /usr/home/pavel.timofeev/mips/12/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c:671:13: error: taking address of packed member of 'struct ar5210_desc' may result in an unaligned pointer value [-Werror=address-of-packe d-member] 671 | *linkptr = &ads->ds_link; | ^~~~~~~~~~~~~ cc1: all warnings being treated as errors --- ar5210_xmit.o --- *** [ar5210_xmit.o] Error code 1 make[4]: stopped in /usr/home/pavel.timofeev/mips/12/sys/modules/ath_hal_ar5210 1 error Fix from HEAD https://svnweb.freebsd.org/base?view=revision&revision=355970 I do not know the policy about GCC architectures, but it would be great to make them buildable with GCC version up to date.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAoTqfv8sP8AOumyYd_mG_xPb90p9rHbQLPVBpn0Z5pCXBzHPg>