* using musl-cross-make to build host gcc
@ 2018-11-11 11:11 argante
2018-11-11 14:13 ` Markus Wichmann
0 siblings, 1 reply; 8+ messages in thread
From: argante @ 2018-11-11 11:11 UTC (permalink / raw)
To: musl
Hi,
I would like to compile gcc for my host using musl-cross-make. I copied statically linked tools (cp, mv, sed etc. + musl, zlib) to the new dir (system layout) and, of course musl-cross. Then chroot to dir and built necessary libraries (gmp, mpc, mpfr). I installed new libraries in /usr/local/{include,lib} and also copied them (.so and headers) in to cross/x86_64-linux-musl/{include,lib}. Then I built binutils, which I also installed in /usr/local.
I used all musl-cross-make patches for gcc. The compilation went without any problems. I installed gcc in /usr/local and removed the cross gcc.
After all I could compile binutils and libraries using the new compiler. Unfortunately, the compilation of gcc itself ends with a strange error.
checking how to run the C preprocessor... x86_64-linux-musl-gcc -E
checking for inline... inline
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of void *... 0
checking size of short... 0
checking size of int... 0
checking size of long... 0
checking for long long... yes
checking size of long long... configure: error: in `/tmp/ports/gcc/work/gcc-7.3.0/host-x86_64-linux-musl/gcc':
configure: error: cannot compute sizeof (long long)
See `config.log' for more details.
make[2]: *** [configure-stage1-gcc] Error 77
make[2]: Leaving directory `/tmp/ports/gcc/work/gcc-7.3.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/ports/gcc/work/gcc-7.3.0'
make: *** [all] Error 2
cannot compute sizeof (long long)???
# cat test.c
#include <stdio.h>
#include <stdint.h>
int main()
{
printf("sizeof(char): %d\n", sizeof(char));
printf("sizeof(short): %d\n", sizeof(short));
printf("sizeof(int): %d\n", sizeof(int));
printf("sizeof(long long): %d\n", sizeof(long long));
printf("sizeof(int64_t): %d\n", sizeof(int64_t));
printf("sizeof(void *): %d\n", sizeof(void *));
return 0;
}
# ./a.out
sizeof(char): 1
sizeof(short): 2
sizeof(int): 4
sizeof(long long): 8
sizeof(int64_t): 8
sizeof(void *): 8
And my steps:
patch 0001-ssp_nonshared.diff
patch 0002-posix_memalign.diff
patch 0003-cilkrts.diff
patch 0004-libatomic-test-fix.diff
patch 0005-libgomp-test-fix.diff
patch 0006-libitm-test-fix.diff
patch 0007-libvtv-test-fix.diff
patch 0008-Revert-PR-driver-81523-Make-static-override-pie.diff
patch 0009-Revert-RS6000-linux-startfile-endfile.diff
patch 0010-static-pie-support.diff
patch 0011-j2.diff
patch 0012-s390x-muslldso.diff
patch 0013-microblaze-pr65649.diff
patch 0014-ldbl128-config.diff
patch 0015-m68k.diff
patch 0016-invalid_tls_model.diff
for i in getcwd strtoul clock strncasecmp fnmatch waitpid basename \
strchr snprintf rindex index memcpy mempcpy strcasecmp strsignal \
vsprintf strndup bcmp tmpnam bzero stpncpy memchr insque ffs \
vfork memmove stpcpy bsearch copysign strtod vsnprintf strncmp \
strtol bcopy rename strstr strerror putenv strdup memset memcmp \
vprintf calloc gettimeofday atexit getpagesize strverscmp random \
setenv strrchr asprintf msdos vasprintf vfprintf getopt getopt1; do
rm -f libiberty/${i}.c
touch libiberty/${i}.c
done
# Prevent libffi from being installed
sed -i -e 's/\(install.*:\) install-.*recursive/\1/' "${S}"/libffi/Makefile.in
sed -i -e 's/\(install-data-am:\).*/\1/' "${S}"/libffi/include/Makefile.in
config_arch_flags=
config_arch_target_cflags=
config_arch_target_ldflags=
export libat_cv_have_ifunc=no
./configure \
CFLAGS="-g0 -Os" \
CXXFLAGS="-g0 -Os" \
LDFLAGS="-s" \
--enable-languages=c,c++ \
--disable-nls \
--disable-multilib \
--disable-werror \
--prefix=/usr/local \
--enable-tls \
--disable-libmudflap \
--disable-libsanitizer \
--disable-gnu-indirect-function \
--disable-libmpx \
--enable-deterministic-archives \
--enable-libstdcxx-time \
--host=x86_64-linux-musl \
--build=x86_64-linux-musl \
--disable-libgomp \
--enable-bootstrap
and make...
Any idea about what I'm doing wrong?
Best regards
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: using musl-cross-make to build host gcc
2018-11-11 11:11 using musl-cross-make to build host gcc argante
@ 2018-11-11 14:13 ` Markus Wichmann
2018-11-11 14:23 ` argante
0 siblings, 1 reply; 8+ messages in thread
From: Markus Wichmann @ 2018-11-11 14:13 UTC (permalink / raw)
To: musl
Hi,
look into config.log. It will tell you what really went on. If you see
an error from configure, then a configure check failed. Likely some
header file behaving differently than what they expected, justified or
not.
Ciao,
Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: using musl-cross-make to build host gcc
2018-11-11 14:13 ` Markus Wichmann
@ 2018-11-11 14:23 ` argante
2018-11-11 19:39 ` argante
2018-11-11 19:46 ` Michael Forney
0 siblings, 2 replies; 8+ messages in thread
From: argante @ 2018-11-11 14:23 UTC (permalink / raw)
To: musl
> Hi,
>
> look into config.log. It will tell you what really went on. If you see
> an error from configure, then a configure check failed. Likely some
> header file behaving differently than what they expected, justified or
> not.
>
> Ciao,
> Markus
# cat /tmp/ports/gcc/work/gcc-7.3.0/host-x86_64-linux-musl/gcc/config.log
language_hooks=''
option_includes=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#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 __EXTENSIONS__ 1
#define _ALL_SOURCE 1
#define _GNU_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define _TANDEM_SOURCE 1
#define SIZEOF_VOID_P 0
#define SIZEOF_SHORT 0
#define SIZEOF_INT 0
#define SIZEOF_LONG 0
#define HAVE_LONG_LONG 1
configure: exit 77
As you can see, the sizeof for types is incorrectly set to 0. config.log does not add anything to what I wrote earlier.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: using musl-cross-make to build host gcc
2018-11-11 14:23 ` argante
@ 2018-11-11 19:39 ` argante
2018-11-11 19:46 ` Michael Forney
1 sibling, 0 replies; 8+ messages in thread
From: argante @ 2018-11-11 19:39 UTC (permalink / raw)
To: musl
The compilation starts with lto-plugin and here the size of the types are determined correctly.
checking whether time.h and sys/time.h may both be included... yes
checking whether errno must be declared... no
checking size of int... 4
checking size of long... 8
checking size of size_t... 8
checking for long long... yes
checking size of long long... 8
checking for a 64-bit type... uint64_t
checking for intptr_t... yes
checking for uintptr_t... yes
(...)
make[4]: Leaving directory `/tmp/ports/gcc/work/gcc-7.3.0/host-x86_64-linux-musl/lto-plugin'
make[3]: Leaving directory `/tmp/ports/gcc/work/gcc-7.3.0/host-x86_64-linux-musl/lto-plugin'
Then is the gcc and the size of the types is incorrectly determined.
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of void *... 0
checking size of short... 0
checking size of int... 0
checking size of long... 0
checking for long long... yes
checking size of long long... configure: error: in `/tmp/ports/gcc/work/gcc-7.3.0/host-x86_64-linux-musl/gcc':
configure: error: cannot compute sizeof (long long)
See `config.log' for more details.
make[2]: *** [configure-stage1-gcc] Error 77
make[2]: Leaving directory `/tmp/ports/gcc/work/gcc-7.3.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/ports/gcc/work/gcc-7.3.0'
make: *** [all] Error 2
I can't understand why cross-gcc works correctly and the version built on the host is working incorrectly.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: using musl-cross-make to build host gcc
2018-11-11 14:23 ` argante
2018-11-11 19:39 ` argante
@ 2018-11-11 19:46 ` Michael Forney
2018-11-11 20:00 ` argante
1 sibling, 1 reply; 8+ messages in thread
From: Michael Forney @ 2018-11-11 19:46 UTC (permalink / raw)
To: musl
On 2018-11-11, argante <argante@pm.me> wrote:
> # cat /tmp/ports/gcc/work/gcc-7.3.0/host-x86_64-linux-musl/gcc/config.log
> language_hooks=''
> option_includes=''
>
> ## ----------- ##
> ## confdefs.h. ##
> ## ----------- ##
>
> /* confdefs.h */
> #define PACKAGE_NAME ""
> #define PACKAGE_TARNAME ""
> #define PACKAGE_VERSION ""
> #define PACKAGE_STRING ""
> #define PACKAGE_BUGREPORT ""
> #define PACKAGE_URL ""
> #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 __EXTENSIONS__ 1
> #define _ALL_SOURCE 1
> #define _GNU_SOURCE 1
> #define _POSIX_PTHREAD_SEMANTICS 1
> #define _TANDEM_SOURCE 1
> #define SIZEOF_VOID_P 0
> #define SIZEOF_SHORT 0
> #define SIZEOF_INT 0
> #define SIZEOF_LONG 0
> #define HAVE_LONG_LONG 1
>
> configure: exit 77
>
> As you can see, the sizeof for types is incorrectly set to 0. config.log
> does not add anything to what I wrote earlier.
Can you paste the entire config.log somewhere? As Markus said, it
should contain (earlier in the log) the actual error from gcc, and the
test program which triggered it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: using musl-cross-make to build host gcc
2018-11-11 19:46 ` Michael Forney
@ 2018-11-11 20:00 ` argante
2018-11-11 21:13 ` Michael Forney
0 siblings, 1 reply; 8+ messages in thread
From: argante @ 2018-11-11 20:00 UTC (permalink / raw)
To: musl
> > cat /tmp/ports/gcc/work/gcc-7.3.0/host-x86_64-linux-musl/gcc/config.log
> >
> > ========================================================================
> >
> > language_hooks=''
> > option_includes=''
> >
> > -----------
> >
> > ------------
> >
> > confdefs.h.
> >
> > ------------
> >
> > -----------
> >
> > ------------
> >
> > /* confdefs.h */
> > #define PACKAGE_NAME ""
> > #define PACKAGE_TARNAME ""
> > #define PACKAGE_VERSION ""
> > #define PACKAGE_STRING ""
> > #define PACKAGE_BUGREPORT ""
> > #define PACKAGE_URL ""
> > #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 EXTENSIONS 1
> > #define _ALL_SOURCE 1
> > #define _GNU_SOURCE 1
> > #define _POSIX_PTHREAD_SEMANTICS 1
> > #define _TANDEM_SOURCE 1
> > #define SIZEOF_VOID_P 0
> > #define SIZEOF_SHORT 0
> > #define SIZEOF_INT 0
> > #define SIZEOF_LONG 0
> > #define HAVE_LONG_LONG 1
> > configure: exit 77
> > As you can see, the sizeof for types is incorrectly set to 0. config.log
> > does not add anything to what I wrote earlier.
>
> Can you paste the entire config.log somewhere? As Markus said, it
> should contain (earlier in the log) the actual error from gcc, and the
> test program which triggered it.
========================================================================
It was the whole file.
1) lto-plugin (full and correct)
# cat /mnt/vz/tmp/ports/gcc/work/gcc-7.3.0/host-x86_64-linux-musl/lto-plugin/config.log
ACLOCAL='${SHELL} /tmp/ports/gcc/work/gcc-7.3.0/missing --run aclocal-1.11'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AR='ar'
AUTOCONF='${SHELL} /tmp/ports/gcc/work/gcc-7.3.0/missing --run autoconf'
AUTOHEADER='${SHELL} /tmp/ports/gcc/work/gcc-7.3.0/missing --run autoheader'
AUTOMAKE='${SHELL} /tmp/ports/gcc/work/gcc-7.3.0/missing --run automake-1.11'
AWK='awk'
CC='x86_64-linux-musl-gcc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g'
CPP='x86_64-linux-musl-gcc -E'
CPPFLAGS=''
CYGPATH_W='echo'
DEFS='-DHAVE_CONFIG_H'
DEPDIR='.deps'
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/usr/bin/grep -E'
EXEEXT=''
FGREP='/usr/bin/grep -F'
GREP='/usr/bin/grep'
INSTALL_DATA='/usr/bin/install -c -m 644'
INSTALL_PROGRAM='/usr/bin/install -c'
INSTALL_SCRIPT='/usr/bin/install -c'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD='ld -m elf_x86_64'
LDFLAGS=' -s'
LIBOBJS=''
LIBS=''
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
LIPO=''
LN_S='ln -s'
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='/tmp/ports/gcc/work/gcc-7.3.0/missing makeinfo --split-size=5000000 --split-size=5000000'
MKDIR_P='../.././lto-plugin/../install-sh -c -d'
NM='nm'
NMEDIT=''
OBJDUMP='objdump'
OBJEXT='o'
OTOOL64=''
OTOOL=''
PACKAGE='lto-plugin'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='LTO plugin for ld'
PACKAGE_STRING='LTO plugin for ld 0.1'
PACKAGE_TARNAME='lto-plugin'
PACKAGE_URL=''
PACKAGE_VERSION='0.1'
PATH_SEPARATOR=':'
RANLIB='ranlib'
SED='/usr/bin/sed'
SET_MAKE=''
SHELL='/bin/sh'
STRIP='strip'
VERSION='0.1'
ac_ct_CC=''
ac_ct_DUMPBIN=''
ac_lto_plugin_ldflags='-Wc,-static-libgcc'
ac_lto_plugin_warn_cflags='-Wall'
accel_dir_suffix=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE='#'
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=' -I$(srcdir)'
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-musl'
build_alias='x86_64-linux-musl'
build_cpu='x86_64'
build_libsubdir='build-x86_64-linux-musl'
build_os='linux-musl'
build_subdir='build-x86_64-linux-musl'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='${prefix}'
gcc_build_dir='../../host-x86_64-linux-musl/gcc'
get_gcc_base_ver='cat'
host='x86_64-pc-linux-musl'
host_alias='x86_64-linux-musl'
host_cpu='x86_64'
host_os='linux-musl'
host_subdir='host-x86_64-linux-musl'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /tmp/ports/gcc/work/gcc-7.3.0/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
lt_host_flags=''
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/../.././lto-plugin/../install-sh -c -d'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,y,y,'
psdir='${docdir}'
real_target_noncanonical='x86_64-linux-musl'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target='x86_64-pc-linux-musl'
target_alias='x86_64-linux-musl'
target_cpu='x86_64'
target_noncanonical='x86_64-linux-musl'
target_os='linux-musl'
target_subdir='x86_64-linux-musl'
target_vendor='pc'
with_libiberty='../libiberty'
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME "LTO plugin for ld"
#define PACKAGE_TARNAME "lto-plugin"
#define PACKAGE_VERSION "0.1"
#define PACKAGE_STRING "LTO plugin for ld 0.1"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "lto-plugin"
#define VERSION "0.1"
#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 __EXTENSIONS__ 1
#define _ALL_SOURCE 1
#define _GNU_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define _TANDEM_SOURCE 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define HAVE_SYS_WAIT_H 1
configure: exit 0
========================================================================
2) gcc's config.log (error)
# cat /tmp/ports/gcc/work/gcc-7.3.0/host-x86_64-linux-musl/gcc/config.log
language_hooks=''
option_includes=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#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 __EXTENSIONS__ 1
#define _ALL_SOURCE 1
#define _GNU_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define _TANDEM_SOURCE 1
#define SIZEOF_VOID_P 0
#define SIZEOF_SHORT 0
#define SIZEOF_INT 0
#define SIZEOF_LONG 0
#define HAVE_LONG_LONG 1
configure: exit 77
========================================================================
and nothing more. This is the first time I have encountered such an error.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: using musl-cross-make to build host gcc
2018-11-11 20:00 ` argante
@ 2018-11-11 21:13 ` Michael Forney
2018-11-11 21:39 ` argante
0 siblings, 1 reply; 8+ messages in thread
From: Michael Forney @ 2018-11-11 21:13 UTC (permalink / raw)
To: musl
On 2018-11-11, argante <argante@pm.me> wrote:
> It was the whole file.
Are you sure you/something did not modify config.log (or paste from
the terminal after it scrolled off the screen)? It looks like it is
just the end bit. The full config.log should have logs for all the
tests it ran (even the ones that passed), and should start with
something like
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.64.
If this really is the full config.log, then I have no other ideas, sorry.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: using musl-cross-make to build host gcc
2018-11-11 21:13 ` Michael Forney
@ 2018-11-11 21:39 ` argante
0 siblings, 0 replies; 8+ messages in thread
From: argante @ 2018-11-11 21:39 UTC (permalink / raw)
To: musl
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, 11 November 2018 22:13, Michael Forney wrote:
> On 2018-11-11, argante argante@pm.me wrote:
>
> > It was the whole file.
>
> Are you sure you/something did not modify config.log (or paste from
> the terminal after it scrolled off the screen)? It looks like it is
> just the end bit. The full config.log should have logs for all the
> tests it ran (even the ones that passed), and should start with
> something like
I'm sure, unfortunately. I have checked several times and the same small config.log is generated with incorrect sizes for types.
For me it is also very mysterious.
btw. Michael, I really like the stuff you create (velox, oasis etc.).
thx
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-11-11 21:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-11 11:11 using musl-cross-make to build host gcc argante
2018-11-11 14:13 ` Markus Wichmann
2018-11-11 14:23 ` argante
2018-11-11 19:39 ` argante
2018-11-11 19:46 ` Michael Forney
2018-11-11 20:00 ` argante
2018-11-11 21:13 ` Michael Forney
2018-11-11 21:39 ` argante
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).