public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug go/68931] gccgo fails to build using MUSL libc
       [not found] <bug-68931-4@http.gcc.gnu.org/bugzilla/>
@ 2020-10-17 14:01 ` daniel.santos at pobox dot com
  2020-10-17 15:51 ` daniel.santos at pobox dot com
  2021-12-27 23:13 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: daniel.santos at pobox dot com @ 2020-10-17 14:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68931

Daniel Santos <daniel.santos at pobox dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.santos at pobox dot com

--- Comment #4 from Daniel Santos <daniel.santos at pobox dot com> ---
Hello.  This is still a problem in 10.2 and I'm definitely going to need to
solve this.  As near as I can tell, the underlying issue is libgo/config.h
incorrectly being populated with HAVE_OFF64_T.

configure:11206: checking for off64_t
configure:11206:
/home/daniel/proj/embedded/openwrt/head/build_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/gcc-10.2.0-final/./gcc/xgcc
-B/home/daniel/proj/embedded/openwrt/head/build_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/gcc-10.2.0-final/./gcc/
-B/home/daniel/proj/embedded/openwrt/head/staging_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/mipsel-openwrt-linux-musl/bin/
-B/home/daniel/proj/embedded/openwrt/head/staging_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/mipsel-openwrt-linux-musl/lib/
-isystem
/home/daniel/proj/embedded/openwrt/head/staging_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/mipsel-openwrt-linux-musl/include
-isystem
/home/daniel/proj/embedded/openwrt/head/staging_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/mipsel-openwrt-linux-musl/sys-include
   -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -g3 -fno-caller-saves
-fno-plt -fhonour-copts -Wno-error=unused-but-set-variable
-Wno-error=unused-result -msoft-float -Wformat -Werror=format-security
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  conftest.c >&5
configure:11206: $? = 0
configure:11206:
/home/daniel/proj/embedded/openwrt/head/build_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/gcc-10.2.0-final/./gcc/xgcc
-B/home/daniel/proj/embedded/openwrt/head/build_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/gcc-10.2.0-final/./gcc/
-B/home/daniel/proj/embedded/openwrt/head/staging_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/mipsel-openwrt-linux-musl/bin/
-B/home/daniel/proj/embedded/openwrt/head/staging_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/mipsel-openwrt-linux-musl/lib/
-isystem
/home/daniel/proj/embedded/openwrt/head/staging_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/mipsel-openwrt-linux-musl/include
-isystem
/home/daniel/proj/embedded/openwrt/head/staging_dir/toolchain-mipsel_24kc_gcc-10.2.0_musl/mipsel-openwrt-linux-musl/sys-include
   -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -g3 -fno-caller-saves
-fno-plt -fhonour-copts -Wno-error=unused-but-set-variable
-Wno-error=unused-result -msoft-float -Wformat -Werror=format-security
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  conftest.c >&5
conftest.c: In function 'main':
conftest.c:146:22: error: expected expression before ')' token
  146 | if (sizeof ((off64_t)))
      |                      ^
configure:11206: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "package-unused"
| #define PACKAGE_TARNAME "libgo"
| #define PACKAGE_VERSION "version-unused"
| #define PACKAGE_STRING "package-unused version-unused"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define USE_LIBFFI 1
| #define HAVE_GETIPINFO 1
| #define HAVE_SCHED_H 1
| #define HAVE_SEMAPHORE_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_MMAN_H 1
| #define HAVE_SYSCALL_H 1
| #define HAVE_SYS_EPOLL_H 1
| #define HAVE_SYS_INOTIFY_H 1
| #define HAVE_SYS_PTRACE_H 1
| #define HAVE_SYS_SYSCALL_H 1
| #define HAVE_SYS_USER_H 1
| #define HAVE_SYS_UTSNAME_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_NET_IF_H 1
| #define HAVE_NET_IF_ARP_H 1
| #define HAVE_NET_ROUTE_H 1
| #define HAVE_NETPACKET_PACKET_H 1
| #define HAVE_SYS_PRCTL_H 1
| #define HAVE_SYS_MOUNT_H 1
| #define HAVE_SYS_VFS_H 1
| #define HAVE_SYS_STATFS_H 1
| #define HAVE_SYS_TIMEX_H 1
| #define HAVE_SYS_SYSINFO_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_LINUX_FS_H 1
| #define HAVE_LINUX_PTRACE_H 1
| #define HAVE_LINUX_REBOOT_H 1
| #define HAVE_NETINET_IP_H 1
| #define HAVE_NETINET_IF_ETHER_H 1
| #define HAVE_NETINET_ICMP6_H 1
| #define HAVE_LINUX_FILTER_H 1
| #define HAVE_LINUX_IF_ADDR_H 1
| #define HAVE_LINUX_IF_ETHER_H 1
| #define HAVE_LINUX_IF_TUN_H 1
| #define HAVE_LINUX_NETLINK_H 1
| #define HAVE_LINUX_RTNETLINK_H 1
| #define HAVE_STRERROR_R 1
| #define HAVE_STRSIGNAL 1
| #define HAVE_WAIT4 1
| #define HAVE_MINCORE 1
| #define HAVE_SETENV 1
| #define HAVE_UNSETENV 1
| #define HAVE_DL_ITERATE_PHDR 1
| #define HAVE_MEMMEM 1
| #define HAVE_ACCEPT4 1
| #define HAVE_DUP3 1
| #define HAVE_EPOLL_CREATE1 1
| #define HAVE_FACCESSAT 1
| #define HAVE_FALLOCATE 1
| #define HAVE_FCHMODAT 1
| #define HAVE_FCHOWNAT 1
| #define HAVE_FUTIMESAT 1
| #define HAVE_GETXATTR 1
| #define HAVE_INOTIFY_ADD_WATCH 1
| #define HAVE_INOTIFY_INIT 1
| #define HAVE_INOTIFY_INIT1 1
| #define HAVE_INOTIFY_RM_WATCH 1
| #define HAVE_LISTXATTR 1
| #define HAVE_MKDIRAT 1
| #define HAVE_MKNODAT 1
| #define HAVE_OPEN64 1
| #define HAVE_OPENAT 1
| #define HAVE_PIPE2 1
| #define HAVE_REMOVEXATTR 1
| #define HAVE_RENAMEAT 1
| #define HAVE_SETXATTR 1
| #define HAVE_SYNC_FILE_RANGE 1
| #define HAVE_SPLICE 1
| #define HAVE_SYSCALL 1
| #define HAVE_TEE 1
| #define HAVE_UNLINKAT 1
| #define HAVE_UNSHARE 1
| #define HAVE_UTIMENSAT 1
| #define HAVE_COSL 1
| #define HAVE_EXPL 1
| #define HAVE_LOGL 1
| #define HAVE_SINL 1
| #define HAVE_TANL 1
| #define HAVE_ACOSL 1
| #define HAVE_ASINL 1
| #define HAVE_ATANL 1
| #define HAVE_ATAN2L 1
| #define HAVE_EXPM1L 1
| #define HAVE_LDEXPL 1
| #define HAVE_LOG10L 1
| #define HAVE_LOG1PL 1
| #define HAVE_SEM_TIMEDWAIT 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof ((off64_t)))
|           return 0;
|   ;
|   return 0;
| }
configure:11206: result: yes



Incidentally, here's musl's note on off64_t:
https://wiki.musl-libc.org/faq.html#Q:-Do-I-need-to-define-%3Ccode%3E_LARGEFILE64_SOURCE%3C/code%3E-to-get-64bit-%3Ccode%3Eoff_t%3C/code%3E?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug go/68931] gccgo fails to build using MUSL libc
       [not found] <bug-68931-4@http.gcc.gnu.org/bugzilla/>
  2020-10-17 14:01 ` [Bug go/68931] gccgo fails to build using MUSL libc daniel.santos at pobox dot com
@ 2020-10-17 15:51 ` daniel.santos at pobox dot com
  2021-12-27 23:13 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: daniel.santos at pobox dot com @ 2020-10-17 15:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68931

--- Comment #5 from Daniel Santos <daniel.santos at pobox dot com> ---
Created attachment 49393
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49393&action=edit
Patch for musl compatibility

The root problem is that musl defines off64_t and loff_t as preprocessor
macros.  These end up in gen-sysinfo.go as "// undefinedmacro" entries. 
Perhaps the real solution would be for -fdump-go-spec to attempt to determine
when a macro is for a type?

There is also a problem currently with struct sysinfo being defined multiple
times due to musl defining it in sys/sysinfo.h instead of including
linux/sysinfo.h -- I've just altered the musl header for now.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug go/68931] gccgo fails to build using MUSL libc
       [not found] <bug-68931-4@http.gcc.gnu.org/bugzilla/>
  2020-10-17 14:01 ` [Bug go/68931] gccgo fails to build using MUSL libc daniel.santos at pobox dot com
  2020-10-17 15:51 ` daniel.santos at pobox dot com
@ 2021-12-27 23:13 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-27 23:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68931

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
             Status|UNCONFIRMED                 |RESOLVED
           Keywords|                            |build
         Resolution|---                         |FIXED

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this is all fixed on the trunk after r12-5979 so closing as fixed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-27 23:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-68931-4@http.gcc.gnu.org/bugzilla/>
2020-10-17 14:01 ` [Bug go/68931] gccgo fails to build using MUSL libc daniel.santos at pobox dot com
2020-10-17 15:51 ` daniel.santos at pobox dot com
2021-12-27 23:13 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).