All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] glibc: Remove site_config and glibc-initial
@ 2018-12-20  0:15 Richard Purdie
  2018-12-20  0:15 ` [PATCH 2/4] gcc: Drop gcc-cross-initial and use gcc-cross instead Richard Purdie
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Richard Purdie @ 2018-12-20  0:15 UTC (permalink / raw)
  To: openembedded-core

The only reason we appear to need glibc-initial at this time is to support
the site_config code. The site_config code compiles and therefore needs
at least some level of working C library to link against.

This isn't a good reason to keep the complexity of glibc-initial around
so remove it, and the site_config support which then breaks.

Performance benchmarks suggest the time spent just rerunning configure
for site_config just about equals any performance benefit for OE-Core
image builds excluding the time spent adding glibc-initial to the
dependency chain.

I'm not opposed to readding some other form of site_config support
but it needs to be rethought.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-core/glibc/glibc-initial.inc     |  57 ---
 meta/recipes-core/glibc/glibc-initial_2.28.bb |   9 -
 meta/recipes-core/glibc/glibc.inc             |  16 +-
 meta/recipes-core/glibc/site_config/funcs     | 474 ------------------
 meta/recipes-core/glibc/site_config/headers   | 155 ------
 meta/recipes-core/glibc/site_config/types     |  21 -
 6 files changed, 1 insertion(+), 731 deletions(-)
 delete mode 100644 meta/recipes-core/glibc/glibc-initial.inc
 delete mode 100644 meta/recipes-core/glibc/glibc-initial_2.28.bb
 delete mode 100644 meta/recipes-core/glibc/site_config/funcs
 delete mode 100644 meta/recipes-core/glibc/site_config/headers
 delete mode 100644 meta/recipes-core/glibc/site_config/types

diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc
deleted file mode 100644
index acd0d6b1dc5..00000000000
--- a/meta/recipes-core/glibc/glibc-initial.inc
+++ /dev/null
@@ -1,57 +0,0 @@
-DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial libgcc-initial make-native bison-native"
-PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
-
-PACKAGES = ""
-PACKAGES_DYNAMIC = ""
-
-STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
-STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
-
-do_configure () {
-	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
-	find ${S} -name "configure" | xargs touch
-	cfgscript=`python3 -c "import os; print(os.path.relpath('${S}', '.'))"`/configure
-	$cfgscript --host=${TARGET_SYS} --build=${BUILD_SYS} \
-		--prefix=/usr \
-		--disable-sanity-checks \
-		--with-headers=${STAGING_DIR_TARGET}${includedir} \
-		--enable-hacker-mode
-}
-
-do_compile () {
-	:
-}
-
-do_install () {
-	oe_runmake cross-compiling=yes install_root=${D} \
-	includedir='${includedir}' prefix='${prefix}' \
-	install-bootstrap-headers=yes install-headers
-
-	oe_runmake csu/subdir_lib
-	mkdir -p ${D}${libdir}/
-	install -m 644 csu/crt[1in].o ${D}${libdir}
-
-	# Two headers -- stubs.h and features.h -- aren't installed by install-headers,
-	# so do them by hand.  We can tolerate an empty stubs.h for the moment.
-	# See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
-	mkdir -p ${D}${includedir}/gnu/
-	touch ${D}${includedir}/gnu/stubs.h
-	cp ${S}/include/features.h ${D}${includedir}/features.h
-
-	if [ -e ${B}/bits/stdio_lim.h ]; then
-		cp ${B}/bits/stdio_lim.h  ${D}${includedir}/bits/
-	fi
-}
-
-do_stash_locale() {
-	:
-}
-
-do_siteconfig () {
-	:
-}
-
-inherit nopackages
-
-# We really only want this built by things that need it, not any recrdeptask
-deltask do_build
diff --git a/meta/recipes-core/glibc/glibc-initial_2.28.bb b/meta/recipes-core/glibc/glibc-initial_2.28.bb
deleted file mode 100644
index e86770e12d4..00000000000
--- a/meta/recipes-core/glibc/glibc-initial_2.28.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-require glibc_${PV}.bb
-require glibc-initial.inc
-
-# main glibc recipes muck with TARGET_CPPFLAGS to point into
-# final target sysroot but we
-# are not there when building glibc-initial
-# so reset it here
-
-TARGET_CPPFLAGS = ""
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index 99c92ce46e4..43e71337eef 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -15,21 +15,7 @@ python () {
         bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
 }
 
-# siteconfig.bbclass runs configure which needs a working compiler
-# For the compiler to work we need a working libc yet libc isn't
-# in the sysroots directory at this point. This means the libc.so
-# linker script won't work as the --sysroot setting isn't correct.
-# Here we create a hacked up libc linker script and pass in the right
-# flags to let configure work. Ugly.
-EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
-siteconfig_do_siteconfig_gencache_prepend = " \
-	mkdir -p ${WORKDIR}/site_config_libc; \
-	cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
-	sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
-"
-
-# nptl needs unwind support in gcc, which can't be built without glibc.
-DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers"
 
 PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
 PROVIDES += "virtual/libintl virtual/libiconv"
diff --git a/meta/recipes-core/glibc/site_config/funcs b/meta/recipes-core/glibc/site_config/funcs
deleted file mode 100644
index ccc85392d7f..00000000000
--- a/meta/recipes-core/glibc/site_config/funcs
+++ /dev/null
@@ -1,474 +0,0 @@
-a64l
-abs
-access
-__adjtimex
-alarm
-alphasort
-argz_append
-__argz_count
-argz_create_sep
-argz_insert
-__argz_next
-argz_next
-__argz_stringify
-argz_stringify
-asprintf
-atexit
-atof
-atoi
-bcmp
-bcopy
-bindresvport
-bind_textdomain_codeset
-btowc
-bzero
-calloc
-canonicalize_file_name
-catgets
-cfgetospeed
-cfsetispeed
-cfsetspeed
-chmod
-chown
-chroot
-clock
-close
-closedir
-closelog
-confstr
-connect
-daemon
-dcgettext
-difftime
-dirfd
-dirname
-dngettext
-dup2
-ecvt
-endgrent
-endmntent
-endpwent
-endutent
-endutxent
-epoll_ctl
-err
-ether_hostton
-ether_ntohost
-euidaccess
-execv
-fchdir
-fchmod
-fchmodat
-fchown
-fchownat
-fcntl
-fcvt
-fdatasync
-fdopendir
-feof_unlocked
-fgets_unlocked
-fgetxattr
-finite
-flistxattr
-flock
-flockfile
-fnmatch
-fork
-fpathconf
-__fpending
-fprintf
-free
-freeaddrinfo
-freeifaddrs
-fseeko
-__fsetlocking
-fsetxattr
-fstat64
-fstat
-fstatfs
-fsync
-ftello
-ftime
-ftruncate
-funlockfile
-futimes
-futimesat
-gai_strerror
-gcvt
-getaddrinfo
-getc_unlocked
-getcwd
-getdelim
-getdomainname
-getdtablesize
-getegid
-getenv
-geteuid
-getgid
-getgrent
-getgrent_r
-getgrgid_r
-getgrnam
-getgrnam_r
-getgrouplist
-getgroups
-gethostbyaddr_r
-gethostbyname2
-gethostbyname
-gethostbyname_r
-gethostent
-gethostid
-gethostname
-getifaddrs
-getline
-getloadavg
-getmntent
-getmsg
-getnameinfo
-getnetbyaddr_r
-getnetgrent_r
-getopt
-getopt_long
-getopt_long_only
-getpagesize
-getpass
-getpeername
-getpgrp
-getpid
-getppid
-getprotoent_r
-getpwent
-getpwent_r
-getpwnam
-getpwnam_r
-getpwuid
-getpwuid_r
-getresuid
-getrlimit
-getrusage
-getservbyname
-getservbyname_r
-getservbyport_r
-getservent
-getservent_r
-getspnam
-getspnam_r
-gettimeofday
-getttyent
-getttynam
-getuid
-getusershell
-getutent
-getutid
-getutline
-getutmp
-getutmpx
-getutxent
-getutxid
-getutxline
-getwd
-getxattr
-glob
-gmtime
-gmtime_r
-grantpt
-group_member
-herror
-hstrerror
-iconv
-iconv_open
-if_freenameindex
-if_indextoname
-if_nameindex
-if_nametoindex
-index
-inet_addr
-inet_aton
-inet_ntoa
-inet_ntop
-inet_pton
-initgroups
-innetgr
-iruserok
-isascii
-isatty
-isblank
-isgraph
-isinf
-isnan
-isprint
-isspace
-iswalnum
-iswcntrl
-iswctype
-iswprint
-iswspace
-iswupper
-isxdigit
-kill
-killpg
-lchown
-lckpwdf
-lgetxattr
-link
-listxattr
-llistxattr
-localtime
-localtime_r
-lockf
-lrand48
-lsearch
-lseek64
-lsetxattr
-lstat
-mallinfo
-malloc
-mblen
-mbrlen
-mbrtowc
-mbsinit
-mbsrtowcs
-mbtowc
-memalign
-memchr
-memcmp
-memcpy
-memmove
-mempcpy
-memrchr
-memset
-mkdir
-mkdirat
-mkdtemp
-mkfifo
-mknod
-mkstemp64
-mkstemp
-mktime
-mlock
-mmap
-mtrace
-munlock
-munmap
-nanosleep
-nice
-nl_langinfo
-ntp_adjtime
-ntp_gettime
-_obstack_free
-on_exit
-open64
-open
-openat
-opendir
-openlog
-pathconf
-pipe
-poll
-popen
-posix_memalign
-prctl
-pread
-printf
-__progname
-pselect
-pthread_mutex_lock
-ptsname
-putenv
-putgrent
-putpwent
-putspent
-pututline
-pututxline
-putwc
-pwrite
-qsort
-raise
-rand
-random
-rand_r
-read
-readdir
-readdir_r
-readlink
-realloc
-realpath
-re_comp
-recvmsg
-re_exec
-regcomp
-regexec
-remove
-rename
-re_search
-rmdir
-rpmatch
-rresvport_af
-ruserok
-ruserok_af
-sbrk
-scandir
-sched_setscheduler
-sched_yield
-__secure_getenv
-select
-semctl
-semget
-sendmsg
-setbuf
-setbuffer
-setegid
-setenv
-seteuid
-setgid
-setgroups
-sethostname
-setitimer
-_setjmp
-setjmp
-setlinebuf
-setlocale
-setmntent
-setpgid
-setpgrp
-setpriority
-setregid
-setresgid
-setresuid
-setreuid
-setrlimit
-setsid
-setsockopt
-settimeofday
-setuid
-setutent
-setutxent
-setvbuf
-setxattr
-sgetspent
-shmat
-shmctl
-shmdt
-shmget
-shutdown
-sigaction
-sigaddset
-sigaltstack
-sigblock
-sigemptyset
-sighold
-siginterrupt
-signal
-sigprocmask
-sigset
-sigsetmask
-sigstack
-sigsuspend
-sigvec
-snprintf
-socket
-socketpair
-sprintf
-srand48
-srand
-srandom
-sscanf
-stat
-statfs
-statvfs
-stime
-stpcpy
-strcasecmp
-strcasestr
-strchr
-strchrnul
-strcmp
-strcspn
-strdup
-strerror
-strerror_r
-strftime
-strlen
-strncasecmp
-strncmp
-strndup
-strnlen
-strpbrk
-strptime
-strrchr
-strsep
-strsignal
-strspn
-strstr
-strtod
-strtoimax
-strtok_r
-strtol
-strtoll
-strtoul
-strtoull
-strtoumax
-strverscmp
-strxfrm
-symlink
-sync
-sysconf
-sysctl
-sysinfo
-syslog
-_sys_siglist
-sys_siglist
-system
-tcgetattr
-tcgetpgrp
-tcsetattr
-tcsetpgrp
-time
-timegm
-times
-timezone
-tmpnam
-towlower
-towupper
-truncate
-tsearch
-ttyname
-tzset
-ulimit
-umask
-uname
-unlink
-unsetenv
-unshare
-updwtmp
-updwtmpx
-usleep
-ustat
-utime
-utimes
-utmpname
-utmpxname
-valloc
-vasprintf
-verrx
-vfork
-vfprintf
-vfscanf
-vhangup
-vprintf
-vsnprintf
-vsprintf
-wait3
-wait4
-waitpid
-wcrtomb
-wcscoll
-wcsdup
-wcslen
-wctob
-wctomb
-wctype
-wcwidth
-wmemchr
-wmemcpy
-wmempcpy
diff --git a/meta/recipes-core/glibc/site_config/headers b/meta/recipes-core/glibc/site_config/headers
deleted file mode 100644
index 69fedea4e1a..00000000000
--- a/meta/recipes-core/glibc/site_config/headers
+++ /dev/null
@@ -1,155 +0,0 @@
-aio.h
-alloca.h
-argz.h
-arpa/inet.h
-arpa/nameser.h
-asm/byteorder.h
-asm/ioctls.h
-asm/page.h
-asm/types.h
-assert.h
-byteswap.h
-ctype.h
-dirent.h
-dlfcn.h
-elf.h
-endian.h
-err.h
-errno.h
-execinfo.h
-fcntl.h
-features.h
-float.h
-fstab.h
-ftw.h
-getopt.h
-glob.h
-grp.h
-iconv.h
-ifaddrs.h
-inttypes.h
-langinfo.h
-lastlog.h
-libgen.h
-libintl.h
-limits.h
-linux/capability.h
-linux/fd.h
-linux/fs.h
-linux/hayesesp.h
-linux/hdreg.h
-linux/icmp.h
-linux/in6.h
-linux/joystick.h
-linux/ptrace.h
-linux/serial.h
-linux/sonypi.h
-linux/unistd.h
-linux/utsname.h
-linux/version.h
-locale.h
-malloc.h
-math.h
-mcheck.h
-memory.h
-mntent.h
-mqueue.h
-netdb.h
-net/if.h
-netinet/ether.h
-netinet/in.h
-netinet/ip6.h
-netinet/ip.h
-netinet/tcp.h
-netinet/udp.h
-netipx/ipx.h
-net/route.h
-paths.h
-poll.h
-pthread.h
-pty.h
-pwd.h
-regex.h
-resolv.h
-rpc/rpc.h
-rpc/types.h
-sched.h
-scsi/scsi.h
-search.h
-semaphore.h
-setjmp.h
-sgtty.h
-shadow.h
-signal.h
-stdarg.h
-stdbool.h
-stdc
-stddef.h
-stdint.h
-stdio.h
-stdlib.h
-string.h
-strings.h
-stropts.h
-sys/bitypes.h
-sys/cdefs.h
-sys/dir.h
-sys/epoll.h
-sysexits.h
-sys/fcntl.h
-sys/file.h
-sys/fsuid.h
-sys/ioctl.h
-sys/ipc.h
-syslog.h
-sys/mman.h
-sys/mount.h
-sys/mtio.h
-sys/param.h
-sys/poll.h
-sys/prctl.h
-sys/ptrace.h
-sys/queue.h
-sys/reg.h
-sys/resource.h
-sys/select.h
-sys/sem.h
-sys/shm.h
-sys/signal.h
-sys/socket.h
-sys/socketvar.h
-sys/soundcard.h
-sys/statfs.h
-sys/stat.h
-sys/statvfs.h
-sys/stropts.h
-sys/swap.h
-sys/sysctl.h
-sys/sysinfo.h
-sys/sysmacros.h
-sys/termios.h
-sys/timeb.h
-sys/time.h
-sys/times.h
-sys/timex.h
-sys/types.h
-sys/uio.h
-sys/un.h
-sys/unistd.h
-sys/user.h
-sys/utsname.h
-sys/vfs.h
-sys/wait.h
-termio.h
-termios.h
-time.h
-ttyent.h
-ulimit.h
-unistd.h
-ustat.h
-utime.h
-utmp.h
-utmpx.h
-values.h
-wchar.h
-wctype.h
diff --git a/meta/recipes-core/glibc/site_config/types b/meta/recipes-core/glibc/site_config/types
deleted file mode 100644
index 178bd85a00b..00000000000
--- a/meta/recipes-core/glibc/site_config/types
+++ /dev/null
@@ -1,21 +0,0 @@
-char
-char *
-double
-float
-int
-long
-long double
-long int
-long long
-long long int
-short
-short int
-signed char
-unsigned char
-unsigned int
-unsigned long
-unsigned long int
-unsigned long long int
-unsigned short
-unsigned short int
-void *
-- 
2.19.1



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

* [PATCH 2/4] gcc: Drop gcc-cross-initial and use gcc-cross instead
  2018-12-20  0:15 [PATCH 1/4] glibc: Remove site_config and glibc-initial Richard Purdie
@ 2018-12-20  0:15 ` Richard Purdie
  2018-12-20  0:55   ` Khem Raj
  2018-12-20  0:15 ` [PATCH 3/4] gcc: Drop the -initial versions of the compiler Richard Purdie
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Richard Purdie @ 2018-12-20  0:15 UTC (permalink / raw)
  To: openembedded-core

We need a libgcc to build glibc. Tranditionally we therefore build
a non-threaded and non-shared compiler (gcc-cross-initial), then use
that to build libgcc-initial which is used to build glibc which we can
then build gcc-cross and libgcc against.

Firstly, we can drop the glibc dependency from gcc-cross, *if* we make
two changes:

a) specify the minimum glibc version to support in a configure option
b) create a dummy limits.h file so that later when glibc creates one,
   the headers structure has support for it. We can do this with a simple
   empty file

Once gcc-cross is libc independent, we can use it to build both
libgcc-initial and then later libgcc.

libgcc-initial is tricky as we need to imitate the non-threaded and
non-shared case. We can do that by hacking the threading mode back to
"single" even if gcc reports "posix" and disable libc presence for the
libgcc-intial build. We have to create the dummy limits.h to avoid
compiler errors from a missing header.

glibc will fail to link with libgcc-initial due to a missing "exception
handler" capable libgcc (libgcc_eh.a). Since we know glibc doesn't need
any exception handler, we can safely symlink to libgcc.a.

With those changes, gcc-cross can be used in all places and we only need
one build of gcc for each architecture.

For some reason ifunc was being disabled on mips prior to these changes
but afterwards became enabled but caused assertion failures. This is
therefore disabled until we can debug that.

The glibc version is a minimum and only used on ppc in the gcc code, it
doesn't need to be rigerously kept exactly up to date.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-core/glibc/glibc.inc             |  5 +-
 .../gcc/gcc-configure-common.inc              |  3 ++
 .../gcc/gcc-cross-canadian.inc                |  2 +-
 meta/recipes-devtools/gcc/gcc-cross.inc       |  8 ++-
 meta/recipes-devtools/gcc/libgcc-initial.inc  | 52 ++++++++++++++++---
 meta/recipes-devtools/gcc/libgcc.inc          |  2 +-
 6 files changed, 61 insertions(+), 11 deletions(-)

diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index 43e71337eef..de692fbfd75 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -15,7 +15,7 @@ python () {
         bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
 }
 
-DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
 
 PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
 PROVIDES += "virtual/libintl virtual/libiconv"
@@ -33,6 +33,9 @@ CACHED_CONFIGUREVARS += " \
   libc_cv_ssp=no \
 "
 
+# ifunc doesn't appear to work on mips, casuses libbfd assertion failures
+CACHED_CONFIGUREVARS_append_mipsarch = " libc_cv_ld_gnu_indirect_function=no"
+
 GLIBC_EXTRA_OECONF ?= ""
 GLIBC_EXTRA_OECONF_class-nativesdk = ""
 INHIBIT_DEFAULT_DEPS = "1"
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index e2ce234aa14..009ab111683 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -24,6 +24,8 @@ GCCTHREADS ?= "posix"
 
 GCCPIE ??= ""
 
+# glibc version is a minimum and doesn't need to track glibc exactly
+# only governs ppc specific features in much older glibc versions
 EXTRA_OECONF = "\
     ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS') != 'no']} \
     --with-gnu-ld \
@@ -38,6 +40,7 @@ EXTRA_OECONF = "\
     --enable-libstdcxx-pch \
     --program-prefix=${TARGET_PREFIX} \
     --without-local-prefix \
+    --with-glibc-version=2.28 \
     ${EXTRA_OECONF_BASE} \
     ${EXTRA_OECONF_GCC_FLOAT} \
     ${EXTRA_OECONF_PATHS} \
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index 2f32d3407fb..73f1e054463 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -3,7 +3,7 @@ inherit cross-canadian
 SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)"
 PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 
-DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext flex-native"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext flex-native virtual/libc"
 
 GCCMULTILIB = "--enable-multilib"
 
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 89b19684bef..63a196e2e99 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -2,7 +2,7 @@ inherit cross
 
 INHIBIT_DEFAULT_DEPS = "1"
 EXTRADEPENDS = ""
-DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}"
+DEPENDS = "virtual/${TARGET_PREFIX}binutils ${EXTRADEPENDS} ${NATIVEDEPS}"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
 python () {
     if d.getVar("TARGET_OS").startswith("linux"):
@@ -44,6 +44,12 @@ EXTRA_OECONF_PATHS = "\
 
 ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
 
+
+do_configure_prepend () {
+	install -d ${RECIPE_SYSROOT}${target_includedir}
+	touch ${RECIPE_SYSROOT}${target_includedir}/limits.h
+}
+
 do_compile () {
 	export CC="${BUILD_CC}"
 	export AR_FOR_TARGET="${TARGET_SYS}-ar"
diff --git a/meta/recipes-devtools/gcc/libgcc-initial.inc b/meta/recipes-devtools/gcc/libgcc-initial.inc
index 950ad861e7e..06bf224f734 100644
--- a/meta/recipes-devtools/gcc/libgcc-initial.inc
+++ b/meta/recipes-devtools/gcc/libgcc-initial.inc
@@ -1,20 +1,58 @@
+#
+# Notes on the way the OE cross toolchain now works
+#
+# We need a libgcc to build glibc. Tranditionally we therefore built
+# a non-threaded and non-shared compiler (gcc-cross-initial), then use
+# that to build libgcc-initial which is used to build glibc which we can
+# then build gcc-cross and libgcc against.
+#
+# We were able to drop the glibc dependency from gcc-cross, with two tweaks:
+
+# a) specify the minimum glibc version to support in a configure option
+# b) create a dummy limits.h file so that later when glibc creates one,
+#    the headers structure has support for it. We can do this with a simple
+#    empty file
+#
+# Once gcc-cross is libc independent, we can use it to build both
+# libgcc-initial and then later libgcc.
+#
+# libgcc-initial is tricky as we need to imitate the non-threaded and
+# non-shared case. We can do that by hacking the threading mode back to
+# "single" even if gcc reports "posix" and disable libc presence for the
+# libgcc-intial build. We have to create the dummy limits.h to avoid
+# compiler errors from a missing header.
+#
+# glibc will fail to link with libgcc-initial due to a missing "exception
+# handler" capable libgcc (libgcc_eh.a). Since we know glibc doesn't need
+# any exception handler, we can safely symlink to libgcc.a.
+#
+
 require libgcc-common.inc
 
-DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc"
 
 LICENSE = "GPL-3.0-with-GCC-exception"
 
-STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
-STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
-PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
-
 PACKAGES = ""
 
 EXTRA_OECONF += "--disable-shared"
 
-COMPILERINITIAL = "-initial"
-
 inherit nopackages
 
 # We really only want this built by things that need it, not any recrdeptask
 deltask do_build
+
+do_configure_prepend () {
+	install -d ${STAGING_INCDIR}
+	touch ${STAGING_INCDIR}/limits.h
+	sed -i -e 's#INHIBIT_LIBC_CFLAGS =.*#INHIBIT_LIBC_CFLAGS = -Dinhibit_libc#' ${B}/gcc/libgcc.mvars
+	sed -i -e 's#inhibit_libc = false#inhibit_libc = true#' ${B}/gcc/Makefile
+}
+
+do_configure_append () {
+	sed -i -e 's#thread_header = .*#thread_header = gthr-single.h#' ${B}/${BPN}/Makefile
+}
+
+do_install_append () {
+	ln -s libgcc.a ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc_eh.a
+}
diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
index 5f1dff609c0..e4e0c480076 100644
--- a/meta/recipes-devtools/gcc/libgcc.inc
+++ b/meta/recipes-devtools/gcc/libgcc.inc
@@ -1,6 +1,6 @@
 require libgcc-common.inc
 
-DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ virtual/${MLPREFIX}libc"
 
 do_install_append_class-target () {
 	if [ "${TCLIBC}" != "glibc" ]; then
-- 
2.19.1



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

* [PATCH 3/4] gcc: Drop the -initial versions of the compiler
  2018-12-20  0:15 [PATCH 1/4] glibc: Remove site_config and glibc-initial Richard Purdie
  2018-12-20  0:15 ` [PATCH 2/4] gcc: Drop gcc-cross-initial and use gcc-cross instead Richard Purdie
@ 2018-12-20  0:15 ` Richard Purdie
  2018-12-20  0:15 ` [PATCH 4/4] recipes: Drop virtual/libc-for-gcc Richard Purdie
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Richard Purdie @ 2018-12-20  0:15 UTC (permalink / raw)
  To: openembedded-core

Separated out from the previous commit for clarity, this simply drops
all the -inital pieces of gcc which are no longer needed after the
previous commit.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-8.2.inc         | 14 ---
 meta/recipes-devtools/gcc/gcc-common.inc      |  7 +-
 .../gcc/gcc-configure-common.inc              |  1 -
 .../gcc/gcc-cross-initial.inc                 | 89 -------------------
 .../gcc/gcc-cross-initial_8.2.bb              |  2 -
 meta/recipes-devtools/gcc/gcc-cross.inc       |  4 +-
 .../gcc/gcc-crosssdk-initial.inc              | 10 ---
 .../gcc/gcc-crosssdk-initial_8.2.bb           |  3 -
 meta/recipes-devtools/gcc/gcc-crosssdk.inc    |  2 +-
 9 files changed, 6 insertions(+), 126 deletions(-)
 delete mode 100644 meta/recipes-devtools/gcc/gcc-cross-initial.inc
 delete mode 100644 meta/recipes-devtools/gcc/gcc-cross-initial_8.2.bb
 delete mode 100644 meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
 delete mode 100644 meta/recipes-devtools/gcc/gcc-crosssdk-initial_8.2.bb

diff --git a/meta/recipes-devtools/gcc/gcc-8.2.inc b/meta/recipes-devtools/gcc/gcc-8.2.inc
index 206e1571b29..b6568a046e9 100644
--- a/meta/recipes-devtools/gcc/gcc-8.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-8.2.inc
@@ -107,20 +107,6 @@ EXTRA_OECONF_BASE = "\
     --without-isl \
 "
 
-EXTRA_OECONF_INITIAL = "\
-    --disable-libmudflap \
-    --disable-libgomp \
-    --disable-libitm \
-    --disable-libquadmath \
-    --with-system-zlib \
-    --disable-lto \
-    --disable-plugin \
-    --enable-linker-build-id \
-    --enable-decimal-float=no \
-    --without-isl \
-    --disable-libssp \
-"
-
 EXTRA_OECONF_PATHS = "\
     --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
     --with-sysroot=/not/exist \
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index 06c90336b66..96334e54b4b 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -10,12 +10,11 @@ CVE_PRODUCT = "gcc"
 inherit autotools gettext texinfo
 
 BPN = "gcc"
-COMPILERINITIAL = ""
-COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc${COMPILERINITIAL}:do_gcc_stash_builddir"
-COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc${COMPILERINITIAL}-crosssdk:do_gcc_stash_builddir"
+COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc:do_gcc_stash_builddir"
+COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc-crosssdk:do_gcc_stash_builddir"
 
 python extract_stashed_builddir () {
-    src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}")
+    src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}")
     dest = d.getVar("B")
     oe.path.copyhardlinktree(src, dest)
     staging_processfixme([src + "/fixmepath"], dest, dest, dest, d)
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index 009ab111683..70f7628bc98 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -17,7 +17,6 @@ LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
 
 EXTRA_OECONF_BASE ?= ""
 EXTRA_OECONF_PATHS ?= ""
-EXTRA_OECONF_INITIAL ?= ""
 
 GCCMULTILIB ?= "--disable-multilib"
 GCCTHREADS ?= "posix"
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
deleted file mode 100644
index 892b1dbf2f0..00000000000
--- a/meta/recipes-devtools/gcc/gcc-cross-initial.inc
+++ /dev/null
@@ -1,89 +0,0 @@
-DEPENDS = "virtual/${TARGET_PREFIX}binutils ${NATIVEDEPS}"
-PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
-PACKAGES = ""
-
-INHIBIT_AUTOTOOLS_DEPS = "1"
-INHIBIT_DEFAULT_DEPS = "1"
-
-# We still need gnu-config-native
-DEPENDS_prepend = "gnu-config-native autoconf-native "
-
-PN = "gcc-cross-initial-${TARGET_ARCH}"
-
-CROSS_TARGET_SYS_DIR_append = ".${PN}"
-
-# This is intended to be a -very- basic config
-# sysroot is needed in case we use libc-initial
-EXTRA_OECONF = "\
-    --with-newlib \
-    --without-headers \
-    --disable-shared \
-    --disable-threads \
-    --disable-multilib \
-    --disable-__cxa_atexit \
-    --enable-languages=c \
-    --program-prefix=${TARGET_PREFIX} \
-    --with-sysroot=/not/exist \
-    --with-build-sysroot=${STAGING_DIR_TARGET} \
-    ${EXTRA_OECONF_INITIAL} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
-    ${EXTRA_OECONF_GCC_FLOAT} \
-    ${@get_gcc_ppc_plt_settings(bb, d)} \
-"
-
-EXTRA_OECONF += "--with-native-system-header-dir=${SYSTEMHEADERS}"
-
-do_compile () {
-    oe_runmake all-gcc configure-target-libgcc
-    (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
-}
-
-do_install () {
-	( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h)
-	oe_runmake 'DESTDIR=${D}' install-gcc
-
-	# We don't really need this (here shares/ contains man/, info/, locale/).
-	rm -rf ${D}${datadir}/
-
-	# We use libiberty from binutils
-	find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
-	find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
-
-	# Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
-	# found. These need to be relative paths so they work in different locations.
-	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
-	install -d $dest
-	useld=${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '.bfd', '', d)}
-	ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld${useld} ${dest}ld
-	for t in ar as nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
-		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
-	done
-	# fixed limits.h infact includes the so called real limits.h
-	# which should come from libc but when we build libc-initial
-	# then bunch of configure tests include fixed limits.h which in turn
-	# includes real limits.h but this real limits.h is not staged yet
-	# so we overwirte the generated include-fixed/limits.h for gcc-cross-initial
-	# to get rid references to real limits.h
-	cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include/limits.h
-}
-#
-# Override the default sysroot staging copy since this won't look like a target system
-#
-sysroot_stage_all() {
-	sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
-	install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/
-	install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/
-	mv ${SYSROOT_DESTDIR}${target_base_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/ || true
-	mv ${SYSROOT_DESTDIR}${target_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/ || true
-}
-
-do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/"
-do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
-
-inherit nopackages
-
-COMPILERINITIAL = "-initial"
-
-
-# We really only want this built by things that need it, not any recrdeptask
-deltask do_build
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_8.2.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_8.2.bb
deleted file mode 100644
index 4c73e5ce613..00000000000
--- a/meta/recipes-devtools/gcc/gcc-cross-initial_8.2.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-require recipes-devtools/gcc/gcc-cross_${PV}.bb
-require gcc-cross-initial.inc
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 63a196e2e99..add6b43017d 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -215,8 +215,8 @@ do_gcc_stash_builddir () {
 addtask do_gcc_stash_builddir after do_compile before do_install
 SSTATETASKS += "do_gcc_stash_builddir"
 do_gcc_stash_builddir[sstate-inputdirs] = "${BUILDDIRSTASH}"
-do_gcc_stash_builddir[sstate-outputdirs] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
-do_gcc_stash_builddir[sstate-fixmedir] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+do_gcc_stash_builddir[sstate-outputdirs] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}"
+do_gcc_stash_builddir[sstate-fixmedir] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}"
 
 python do_gcc_stash_builddir_setscene () {
     sstate_setscene(d)
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc b/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
deleted file mode 100644
index 08eda5d4c7c..00000000000
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-inherit crosssdk
-
-PN = "gcc-crosssdk-initial-${SDK_SYS}"
-
-SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
-SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/"
-SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
-
-DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native ${NATIVEDEPS}"
-PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial-crosssdk"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_8.2.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_8.2.bb
deleted file mode 100644
index fd90e1140f1..00000000000
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_8.2.bb
+++ /dev/null
@@ -1,3 +0,0 @@
-require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
-require gcc-crosssdk-initial.inc
-
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk.inc b/meta/recipes-devtools/gcc/gcc-crosssdk.inc
index cda29277944..bd2e71d63f1 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk.inc
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk.inc
@@ -8,5 +8,5 @@ SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
 
 GCCMULTILIB = "--disable-multilib"
 
-DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk virtual/nativesdk-${TARGET_PREFIX}libc-for-gcc gettext-native ${NATIVEDEPS}"
+DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native ${NATIVEDEPS}"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc-crosssdk virtual/${TARGET_PREFIX}g++-crosssdk"
-- 
2.19.1



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

* [PATCH 4/4] recipes: Drop virtual/libc-for-gcc
  2018-12-20  0:15 [PATCH 1/4] glibc: Remove site_config and glibc-initial Richard Purdie
  2018-12-20  0:15 ` [PATCH 2/4] gcc: Drop gcc-cross-initial and use gcc-cross instead Richard Purdie
  2018-12-20  0:15 ` [PATCH 3/4] gcc: Drop the -initial versions of the compiler Richard Purdie
@ 2018-12-20  0:15 ` Richard Purdie
  2018-12-20  0:33 ` ✗ patchtest: failure for "glibc: Remove site_config and ..." and 3 more Patchwork
  2018-12-20 11:50 ` [PATCH 1/4] glibc: Remove site_config and glibc-initial Burton, Ross
  4 siblings, 0 replies; 15+ messages in thread
From: Richard Purdie @ 2018-12-20  0:15 UTC (permalink / raw)
  To: openembedded-core

We no longer have special "libc" for gcc so we can rely on plain
virtual/libc and reduce the complexity in the dependencies.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/conf/distro/include/tcmode-default.inc      | 2 --
 meta/conf/layer.conf                             | 1 -
 meta/recipes-core/glibc/glibc.inc                | 2 +-
 meta/recipes-core/musl/musl_git.bb               | 2 +-
 meta/recipes-core/newlib/newlib_3.0.0.bb         | 2 +-
 meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 2 +-
 meta/recipes-devtools/gcc/gcc-cross.inc          | 1 -
 meta/recipes-devtools/gdb/gdb-cross-canadian.inc | 2 +-
 meta/recipes-devtools/go/go-cross-canadian.inc   | 2 +-
 9 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
index a586c63d4b9..c9fed48bce2 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -16,8 +16,6 @@ PREFERRED_PROVIDER_virtual/${SDK_PREFIX}g++ = "gcc-crosssdk-${SDK_SYS}"
 PREFERRED_PROVIDER_virtual/${SDK_PREFIX}compilerlibs = "nativesdk-gcc-runtime"
 
 # Default libc config
-PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "${TCLIBC}"
-PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc ?= "nativesdk-glibc"
 PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "${TCLIBC}-initial"
 PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial ?= "nativesdk-glibc-initial"
 PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index c67dec49ed2..7afccdf3351 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -51,7 +51,6 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
   *->git-native \
   *->ccache-native \
   *->icecc-create-env-native \
-  gcc-cross-${TARGET_ARCH}->virtual/${TARGET_PREFIX}libc-for-gcc \
   gcc-cross-${TARGET_ARCH}->linux-libc-headers \
   ppp-dialin->ppp \
   resolvconf->bash \
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index de692fbfd75..6aee89bb53a 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -17,7 +17,7 @@ python () {
 
 DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
 
-PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
+PROVIDES = "virtual/libc"
 PROVIDES += "virtual/libintl virtual/libiconv"
 inherit autotools texinfo distro_features_check systemd
 
diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index 9cc875c4a61..3dc56cef851 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -17,7 +17,7 @@ SRC_URI = "git://git.musl-libc.org/musl \
 
 S = "${WORKDIR}/git"
 
-PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc virtual/libiconv virtual/libintl virtual/crypt"
+PROVIDES += "virtual/libc virtual/libiconv virtual/libintl virtual/crypt"
 
 DEPENDS = "virtual/${TARGET_PREFIX}binutils \
            virtual/${TARGET_PREFIX}gcc-initial \
diff --git a/meta/recipes-core/newlib/newlib_3.0.0.bb b/meta/recipes-core/newlib/newlib_3.0.0.bb
index 09238fe006b..db13724eb58 100644
--- a/meta/recipes-core/newlib/newlib_3.0.0.bb
+++ b/meta/recipes-core/newlib/newlib_3.0.0.bb
@@ -1,6 +1,6 @@
 require newlib.inc
 
-PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc virtual/libiconv virtual/libintl"
+PROVIDES += "virtual/libc virtual/libiconv virtual/libintl"
 
 do_configure() {
 	${S}/configure ${EXTRA_OECONF}
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index 73f1e054463..e7c08d3a618 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -3,7 +3,7 @@ inherit cross-canadian
 SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)"
 PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 
-DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext flex-native virtual/libc"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-libc nativesdk-gettext flex-native virtual/libc"
 
 GCCMULTILIB = "--enable-multilib"
 
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index add6b43017d..6222c2e8c91 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -31,7 +31,6 @@ EXTRA_OECONF += "\
     --with-system-zlib \
 "
 
-DEPENDS_remove_libc-baremetal := "virtual/${TARGET_PREFIX}libc-for-gcc"
 EXTRA_OECONF_append_libc-baremetal = " --without-headers"
 EXTRA_OECONF_remove_libc-baremetal = "--enable-threads=posix"
 EXTRA_OECONF_remove_libc-newlib = "--enable-threads=posix"
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
index 4fc6747d9da..475e4f08ef0 100644
--- a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
+++ b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
@@ -6,7 +6,7 @@ PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 BPN = "gdb"
 
 DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext \
-           virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc"
+           virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-libc"
 
 GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
 
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc b/meta/recipes-devtools/go/go-cross-canadian.inc
index ea68b8875d9..0bc5dce8a14 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -1,7 +1,7 @@
 inherit cross-canadian
 
 DEPENDS = "go-native virtual/${HOST_PREFIX}go-crosssdk virtual/nativesdk-${HOST_PREFIX}go-runtime \
-           virtual/${HOST_PREFIX}gcc-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc \
+           virtual/${HOST_PREFIX}gcc-crosssdk virtual/nativesdk-libc \
            virtual/nativesdk-${HOST_PREFIX}compilerlibs"
 PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 
-- 
2.19.1



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

* ✗ patchtest: failure for "glibc: Remove site_config and ..." and 3 more
  2018-12-20  0:15 [PATCH 1/4] glibc: Remove site_config and glibc-initial Richard Purdie
                   ` (2 preceding siblings ...)
  2018-12-20  0:15 ` [PATCH 4/4] recipes: Drop virtual/libc-for-gcc Richard Purdie
@ 2018-12-20  0:33 ` Patchwork
  2018-12-20 11:50 ` [PATCH 1/4] glibc: Remove site_config and glibc-initial Burton, Ross
  4 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-12-20  0:33 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

== Series Details ==

Series: "glibc: Remove site_config and ..." and 3 more
Revision: 1
URL   : https://patchwork.openembedded.org/series/15420/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 284596e947)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



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

* Re: [PATCH 2/4] gcc: Drop gcc-cross-initial and use gcc-cross instead
  2018-12-20  0:15 ` [PATCH 2/4] gcc: Drop gcc-cross-initial and use gcc-cross instead Richard Purdie
@ 2018-12-20  0:55   ` Khem Raj
  2018-12-20 10:41     ` richard.purdie
  0 siblings, 1 reply; 15+ messages in thread
From: Khem Raj @ 2018-12-20  0:55 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

Hi Richard

This is a very good change all in all. I have few comments I added.

On Wed, Dec 19, 2018 at 4:16 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> We need a libgcc to build glibc. Tranditionally we therefore build
> a non-threaded and non-shared compiler (gcc-cross-initial), then use
> that to build libgcc-initial which is used to build glibc which we can
> then build gcc-cross and libgcc against.
>
> Firstly, we can drop the glibc dependency from gcc-cross, *if* we make
> two changes:
>
> a) specify the minimum glibc version to support in a configure option
> b) create a dummy limits.h file so that later when glibc creates one,
>    the headers structure has support for it. We can do this with a simple
>    empty file
>
> Once gcc-cross is libc independent, we can use it to build both
> libgcc-initial and then later libgcc.
>
> libgcc-initial is tricky as we need to imitate the non-threaded and
> non-shared case. We can do that by hacking the threading mode back to
> "single" even if gcc reports "posix" and disable libc presence for the
> libgcc-intial build. We have to create the dummy limits.h to avoid
> compiler errors from a missing header.
>
> glibc will fail to link with libgcc-initial due to a missing "exception
> handler" capable libgcc (libgcc_eh.a). Since we know glibc doesn't need
> any exception handler, we can safely symlink to libgcc.a.
>
> With those changes, gcc-cross can be used in all places and we only need
> one build of gcc for each architecture.
>
> For some reason ifunc was being disabled on mips prior to these changes
> but afterwards became enabled but caused assertion failures. This is
> therefore disabled until we can debug that.
>
> The glibc version is a minimum and only used on ppc in the gcc code, it
> doesn't need to be rigerously kept exactly up to date.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/recipes-core/glibc/glibc.inc             |  5 +-
>  .../gcc/gcc-configure-common.inc              |  3 ++
>  .../gcc/gcc-cross-canadian.inc                |  2 +-
>  meta/recipes-devtools/gcc/gcc-cross.inc       |  8 ++-
>  meta/recipes-devtools/gcc/libgcc-initial.inc  | 52 ++++++++++++++++---
>  meta/recipes-devtools/gcc/libgcc.inc          |  2 +-
>  6 files changed, 61 insertions(+), 11 deletions(-)
>
> diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> index 43e71337eef..de692fbfd75 100644
> --- a/meta/recipes-core/glibc/glibc.inc
> +++ b/meta/recipes-core/glibc/glibc.inc
> @@ -15,7 +15,7 @@ python () {
>          bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
>  }
>
> -DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers"
> +DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
>
>  PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
>  PROVIDES += "virtual/libintl virtual/libiconv"
> @@ -33,6 +33,9 @@ CACHED_CONFIGUREVARS += " \
>    libc_cv_ssp=no \
>  "
>
> +# ifunc doesn't appear to work on mips, casuses libbfd assertion failures
> +CACHED_CONFIGUREVARS_append_mipsarch = " libc_cv_ld_gnu_indirect_function=no"

perhaps we should use --disable-gnu-indirect-function to make it more readable.

> +
>  GLIBC_EXTRA_OECONF ?= ""
>  GLIBC_EXTRA_OECONF_class-nativesdk = ""
>  INHIBIT_DEFAULT_DEPS = "1"
> diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> index e2ce234aa14..009ab111683 100644
> --- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
> +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> @@ -24,6 +24,8 @@ GCCTHREADS ?= "posix"
>
>  GCCPIE ??= ""
>
> +# glibc version is a minimum and doesn't need to track glibc exactly
> +# only governs ppc specific features in much older glibc versions

I hope there are no effects of this pinning to glibc 2.28 on non-glibc
builds especially musl.

>  EXTRA_OECONF = "\
>      ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS') != 'no']} \
>      --with-gnu-ld \
> @@ -38,6 +40,7 @@ EXTRA_OECONF = "\
>      --enable-libstdcxx-pch \
>      --program-prefix=${TARGET_PREFIX} \
>      --without-local-prefix \
> +    --with-glibc-version=2.28 \
>      ${EXTRA_OECONF_BASE} \
>      ${EXTRA_OECONF_GCC_FLOAT} \
>      ${EXTRA_OECONF_PATHS} \
> diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
> index 2f32d3407fb..73f1e054463 100644
> --- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
> +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
> @@ -3,7 +3,7 @@ inherit cross-canadian
>  SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)"
>  PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
>
> -DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext flex-native"
> +DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext flex-native virtual/libc"
>
>  GCCMULTILIB = "--enable-multilib"
>
> diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
> index 89b19684bef..63a196e2e99 100644
> --- a/meta/recipes-devtools/gcc/gcc-cross.inc
> +++ b/meta/recipes-devtools/gcc/gcc-cross.inc
> @@ -2,7 +2,7 @@ inherit cross
>
>  INHIBIT_DEFAULT_DEPS = "1"
>  EXTRADEPENDS = ""
> -DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}"
> +DEPENDS = "virtual/${TARGET_PREFIX}binutils ${EXTRADEPENDS} ${NATIVEDEPS}"
>  PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
>  python () {
>      if d.getVar("TARGET_OS").startswith("linux"):
> @@ -44,6 +44,12 @@ EXTRA_OECONF_PATHS = "\
>
>  ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
>
> +
> +do_configure_prepend () {
> +       install -d ${RECIPE_SYSROOT}${target_includedir}
> +       touch ${RECIPE_SYSROOT}${target_includedir}/limits.h

I wonder if we should use install  0644 so we dont have permission
errors not sure what touch will do in that regard

> +}
> +
>  do_compile () {
>         export CC="${BUILD_CC}"
>         export AR_FOR_TARGET="${TARGET_SYS}-ar"
> diff --git a/meta/recipes-devtools/gcc/libgcc-initial.inc b/meta/recipes-devtools/gcc/libgcc-initial.inc
> index 950ad861e7e..06bf224f734 100644
> --- a/meta/recipes-devtools/gcc/libgcc-initial.inc
> +++ b/meta/recipes-devtools/gcc/libgcc-initial.inc
> @@ -1,20 +1,58 @@
> +#
> +# Notes on the way the OE cross toolchain now works
> +#
> +# We need a libgcc to build glibc. Tranditionally we therefore built
> +# a non-threaded and non-shared compiler (gcc-cross-initial), then use
> +# that to build libgcc-initial which is used to build glibc which we can
> +# then build gcc-cross and libgcc against.
> +#
> +# We were able to drop the glibc dependency from gcc-cross, with two tweaks:
> +
> +# a) specify the minimum glibc version to support in a configure option
> +# b) create a dummy limits.h file so that later when glibc creates one,
> +#    the headers structure has support for it. We can do this with a simple
> +#    empty file
> +#
> +# Once gcc-cross is libc independent, we can use it to build both
> +# libgcc-initial and then later libgcc.
> +#
> +# libgcc-initial is tricky as we need to imitate the non-threaded and
> +# non-shared case. We can do that by hacking the threading mode back to
> +# "single" even if gcc reports "posix" and disable libc presence for the
> +# libgcc-intial build. We have to create the dummy limits.h to avoid
> +# compiler errors from a missing header.
> +#
> +# glibc will fail to link with libgcc-initial due to a missing "exception
> +# handler" capable libgcc (libgcc_eh.a). Since we know glibc doesn't need
> +# any exception handler, we can safely symlink to libgcc.a.
> +#
> +
>  require libgcc-common.inc
>
> -DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial"
> +DEPENDS = "virtual/${TARGET_PREFIX}gcc"
>
>  LICENSE = "GPL-3.0-with-GCC-exception"
>
> -STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
> -STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
> -PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
> -
>  PACKAGES = ""
>
>  EXTRA_OECONF += "--disable-shared"
>
> -COMPILERINITIAL = "-initial"
> -
>  inherit nopackages
>
>  # We really only want this built by things that need it, not any recrdeptask
>  deltask do_build
> +
> +do_configure_prepend () {
> +       install -d ${STAGING_INCDIR}
> +       touch ${STAGING_INCDIR}/limits.h
> +       sed -i -e 's#INHIBIT_LIBC_CFLAGS =.*#INHIBIT_LIBC_CFLAGS = -Dinhibit_libc#' ${B}/gcc/libgcc.mvars
> +       sed -i -e 's#inhibit_libc = false#inhibit_libc = true#' ${B}/gcc/Makefile
> +}
> +
> +do_configure_append () {
> +       sed -i -e 's#thread_header = .*#thread_header = gthr-single.h#' ${B}/${BPN}/Makefile
> +}
> +
> +do_install_append () {
> +       ln -s libgcc.a ${D}${libdir}/${TARGET_SYS}/${BINV}/libgcc_eh.a
> +}
> diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
> index 5f1dff609c0..e4e0c480076 100644
> --- a/meta/recipes-devtools/gcc/libgcc.inc
> +++ b/meta/recipes-devtools/gcc/libgcc.inc
> @@ -1,6 +1,6 @@
>  require libgcc-common.inc
>
> -DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
> +DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ virtual/${MLPREFIX}libc"
>
>  do_install_append_class-target () {
>         if [ "${TCLIBC}" != "glibc" ]; then
> --
> 2.19.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH 2/4] gcc: Drop gcc-cross-initial and use gcc-cross instead
  2018-12-20  0:55   ` Khem Raj
@ 2018-12-20 10:41     ` richard.purdie
  0 siblings, 0 replies; 15+ messages in thread
From: richard.purdie @ 2018-12-20 10:41 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

On Wed, 2018-12-19 at 16:55 -0800, Khem Raj wrote:
> On Wed, Dec 19, 2018 at 4:16 PM Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > +# ifunc doesn't appear to work on mips, casuses libbfd assertion
> > failures
> > +CACHED_CONFIGUREVARS_append_mipsarch = "
> > libc_cv_ld_gnu_indirect_function=no"
> 
> perhaps we should use --disable-gnu-indirect-function to make it more
> readable.

I did it this way to exactly emulate how it was "failing" prior to the
changes.

> > +
> >  GLIBC_EXTRA_OECONF ?= ""
> >  GLIBC_EXTRA_OECONF_class-nativesdk = ""
> >  INHIBIT_DEFAULT_DEPS = "1"
> > diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc
> > b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> > index e2ce234aa14..009ab111683 100644
> > --- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> > @@ -24,6 +24,8 @@ GCCTHREADS ?= "posix"
> > 
> >  GCCPIE ??= ""
> > 
> > +# glibc version is a minimum and doesn't need to track glibc
> > exactly
> > +# only governs ppc specific features in much older glibc versions
> 
> I hope there are no effects of this pinning to glibc 2.28 on non-
> glibc builds especially musl.

I took a closer look at this. The only platforms that touch it are
rs6000 and the spe port. For linux.h, that only changes one thing in
gcc/config/rs6000/rs6000.c for glibc 2.19 or higher:

/* Support for TARGET_ATOMIC_ASSIGN_EXPAND_FENV without FPRs depends
   on glibc 2.19 or greater.  */
#define RS6000_GLIBC_ATOMIC_FENV 1

For the linux64.h part:

/* Split stack is only supported for 64 bit, and requires glibc >=
2.18.  */
#  define TARGET_CAN_SPLIT_STACK
#   define TARGET_CAN_SPLIT_STACK_64BIT 1
#   define TARGET_CAN_SPLIT_STACK_64BIT 0

Are those going to cause problems on musl?


> 
> >  EXTRA_OECONF = "\
> >      ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS') !=
> > 'no']} \
> >      --with-gnu-ld \
> > @@ -38,6 +40,7 @@ EXTRA_OECONF = "\
> >      --enable-libstdcxx-pch \
> >      --program-prefix=${TARGET_PREFIX} \
> >      --without-local-prefix \
> > +    --with-glibc-version=2.28 \
> >      ${EXTRA_OECONF_BASE} \
> >      ${EXTRA_OECONF_GCC_FLOAT} \
> >      ${EXTRA_OECONF_PATHS} \
> > diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
> > b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
> > index 2f32d3407fb..73f1e054463 100644
> > --- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
> > @@ -3,7 +3,7 @@ inherit cross-canadian
> >  SUMMARY = "GNU cc and gcc C compilers (cross-canadian for
> > ${TARGET_ARCH} target)"
> >  PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
> > 
> > -DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-
> > crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-
> > ${HOST_PREFIX}libc-for-gcc nativesdk-gettext flex-native"
> > +DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-
> > crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-
> > ${HOST_PREFIX}libc-for-gcc nativesdk-gettext flex-native
> > virtual/libc"
> > 
> >  GCCMULTILIB = "--enable-multilib"
> > 
> > diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc
> > b/meta/recipes-devtools/gcc/gcc-cross.inc
> > index 89b19684bef..63a196e2e99 100644
> > --- a/meta/recipes-devtools/gcc/gcc-cross.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-cross.inc
> > @@ -2,7 +2,7 @@ inherit cross
> > 
> >  INHIBIT_DEFAULT_DEPS = "1"
> >  EXTRADEPENDS = ""
> > -DEPENDS = "virtual/${TARGET_PREFIX}binutils
> > virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}"
> > +DEPENDS = "virtual/${TARGET_PREFIX}binutils ${EXTRADEPENDS}
> > ${NATIVEDEPS}"
> >  PROVIDES = "virtual/${TARGET_PREFIX}gcc
> > virtual/${TARGET_PREFIX}g++"
> >  python () {
> >      if d.getVar("TARGET_OS").startswith("linux"):
> > @@ -44,6 +44,12 @@ EXTRA_OECONF_PATHS = "\
> > 
> >  ARCH_FLAGS_FOR_TARGET += "-
> > isystem${STAGING_DIR_TARGET}${target_includedir}"
> > 
> > +
> > +do_configure_prepend () {
> > +       install -d ${RECIPE_SYSROOT}${target_includedir}
> > +       touch ${RECIPE_SYSROOT}${target_includedir}/limits.h
> 
> I wonder if we should use install  0644 so we dont have permission
> errors not sure what touch will do in that regard

The file isn't packaged and we're not in pseudo context so it shouldn't
matter here as we're just poking something into our own recipe
sysroot...

Cheers,

Richard



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

* Re: [PATCH 1/4] glibc: Remove site_config and glibc-initial
  2018-12-20  0:15 [PATCH 1/4] glibc: Remove site_config and glibc-initial Richard Purdie
                   ` (3 preceding siblings ...)
  2018-12-20  0:33 ` ✗ patchtest: failure for "glibc: Remove site_config and ..." and 3 more Patchwork
@ 2018-12-20 11:50 ` Burton, Ross
  2018-12-20 11:58   ` richard.purdie
  4 siblings, 1 reply; 15+ messages in thread
From: Burton, Ross @ 2018-12-20 11:50 UTC (permalink / raw)
  To: Purdie, Richard; +Cc: OE-core

As the only users of siteconfig are now zlib and ncurses, should we
just rip it out entirely leaving a gap for a fresh implementation?

Ross
On Thu, 20 Dec 2018 at 00:16, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> The only reason we appear to need glibc-initial at this time is to support
> the site_config code. The site_config code compiles and therefore needs
> at least some level of working C library to link against.
>
> This isn't a good reason to keep the complexity of glibc-initial around
> so remove it, and the site_config support which then breaks.
>
> Performance benchmarks suggest the time spent just rerunning configure
> for site_config just about equals any performance benefit for OE-Core
> image builds excluding the time spent adding glibc-initial to the
> dependency chain.
>
> I'm not opposed to readding some other form of site_config support
> but it needs to be rethought.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/recipes-core/glibc/glibc-initial.inc     |  57 ---
>  meta/recipes-core/glibc/glibc-initial_2.28.bb |   9 -
>  meta/recipes-core/glibc/glibc.inc             |  16 +-
>  meta/recipes-core/glibc/site_config/funcs     | 474 ------------------
>  meta/recipes-core/glibc/site_config/headers   | 155 ------
>  meta/recipes-core/glibc/site_config/types     |  21 -
>  6 files changed, 1 insertion(+), 731 deletions(-)
>  delete mode 100644 meta/recipes-core/glibc/glibc-initial.inc
>  delete mode 100644 meta/recipes-core/glibc/glibc-initial_2.28.bb
>  delete mode 100644 meta/recipes-core/glibc/site_config/funcs
>  delete mode 100644 meta/recipes-core/glibc/site_config/headers
>  delete mode 100644 meta/recipes-core/glibc/site_config/types
>
> diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc
> deleted file mode 100644
> index acd0d6b1dc5..00000000000
> --- a/meta/recipes-core/glibc/glibc-initial.inc
> +++ /dev/null
> @@ -1,57 +0,0 @@
> -DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial libgcc-initial make-native bison-native"
> -PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
> -
> -PACKAGES = ""
> -PACKAGES_DYNAMIC = ""
> -
> -STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
> -STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
> -
> -do_configure () {
> -       (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
> -       find ${S} -name "configure" | xargs touch
> -       cfgscript=`python3 -c "import os; print(os.path.relpath('${S}', '.'))"`/configure
> -       $cfgscript --host=${TARGET_SYS} --build=${BUILD_SYS} \
> -               --prefix=/usr \
> -               --disable-sanity-checks \
> -               --with-headers=${STAGING_DIR_TARGET}${includedir} \
> -               --enable-hacker-mode
> -}
> -
> -do_compile () {
> -       :
> -}
> -
> -do_install () {
> -       oe_runmake cross-compiling=yes install_root=${D} \
> -       includedir='${includedir}' prefix='${prefix}' \
> -       install-bootstrap-headers=yes install-headers
> -
> -       oe_runmake csu/subdir_lib
> -       mkdir -p ${D}${libdir}/
> -       install -m 644 csu/crt[1in].o ${D}${libdir}
> -
> -       # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
> -       # so do them by hand.  We can tolerate an empty stubs.h for the moment.
> -       # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
> -       mkdir -p ${D}${includedir}/gnu/
> -       touch ${D}${includedir}/gnu/stubs.h
> -       cp ${S}/include/features.h ${D}${includedir}/features.h
> -
> -       if [ -e ${B}/bits/stdio_lim.h ]; then
> -               cp ${B}/bits/stdio_lim.h  ${D}${includedir}/bits/
> -       fi
> -}
> -
> -do_stash_locale() {
> -       :
> -}
> -
> -do_siteconfig () {
> -       :
> -}
> -
> -inherit nopackages
> -
> -# We really only want this built by things that need it, not any recrdeptask
> -deltask do_build
> diff --git a/meta/recipes-core/glibc/glibc-initial_2.28.bb b/meta/recipes-core/glibc/glibc-initial_2.28.bb
> deleted file mode 100644
> index e86770e12d4..00000000000
> --- a/meta/recipes-core/glibc/glibc-initial_2.28.bb
> +++ /dev/null
> @@ -1,9 +0,0 @@
> -require glibc_${PV}.bb
> -require glibc-initial.inc
> -
> -# main glibc recipes muck with TARGET_CPPFLAGS to point into
> -# final target sysroot but we
> -# are not there when building glibc-initial
> -# so reset it here
> -
> -TARGET_CPPFLAGS = ""
> diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> index 99c92ce46e4..43e71337eef 100644
> --- a/meta/recipes-core/glibc/glibc.inc
> +++ b/meta/recipes-core/glibc/glibc.inc
> @@ -15,21 +15,7 @@ python () {
>          bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
>  }
>
> -# siteconfig.bbclass runs configure which needs a working compiler
> -# For the compiler to work we need a working libc yet libc isn't
> -# in the sysroots directory at this point. This means the libc.so
> -# linker script won't work as the --sysroot setting isn't correct.
> -# Here we create a hacked up libc linker script and pass in the right
> -# flags to let configure work. Ugly.
> -EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
> -siteconfig_do_siteconfig_gencache_prepend = " \
> -       mkdir -p ${WORKDIR}/site_config_libc; \
> -       cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
> -       sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
> -"
> -
> -# nptl needs unwind support in gcc, which can't be built without glibc.
> -DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
> +DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers"
>
>  PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
>  PROVIDES += "virtual/libintl virtual/libiconv"
> diff --git a/meta/recipes-core/glibc/site_config/funcs b/meta/recipes-core/glibc/site_config/funcs
> deleted file mode 100644
> index ccc85392d7f..00000000000
> --- a/meta/recipes-core/glibc/site_config/funcs
> +++ /dev/null
> @@ -1,474 +0,0 @@
> -a64l
> -abs
> -access
> -__adjtimex
> -alarm
> -alphasort
> -argz_append
> -__argz_count
> -argz_create_sep
> -argz_insert
> -__argz_next
> -argz_next
> -__argz_stringify
> -argz_stringify
> -asprintf
> -atexit
> -atof
> -atoi
> -bcmp
> -bcopy
> -bindresvport
> -bind_textdomain_codeset
> -btowc
> -bzero
> -calloc
> -canonicalize_file_name
> -catgets
> -cfgetospeed
> -cfsetispeed
> -cfsetspeed
> -chmod
> -chown
> -chroot
> -clock
> -close
> -closedir
> -closelog
> -confstr
> -connect
> -daemon
> -dcgettext
> -difftime
> -dirfd
> -dirname
> -dngettext
> -dup2
> -ecvt
> -endgrent
> -endmntent
> -endpwent
> -endutent
> -endutxent
> -epoll_ctl
> -err
> -ether_hostton
> -ether_ntohost
> -euidaccess
> -execv
> -fchdir
> -fchmod
> -fchmodat
> -fchown
> -fchownat
> -fcntl
> -fcvt
> -fdatasync
> -fdopendir
> -feof_unlocked
> -fgets_unlocked
> -fgetxattr
> -finite
> -flistxattr
> -flock
> -flockfile
> -fnmatch
> -fork
> -fpathconf
> -__fpending
> -fprintf
> -free
> -freeaddrinfo
> -freeifaddrs
> -fseeko
> -__fsetlocking
> -fsetxattr
> -fstat64
> -fstat
> -fstatfs
> -fsync
> -ftello
> -ftime
> -ftruncate
> -funlockfile
> -futimes
> -futimesat
> -gai_strerror
> -gcvt
> -getaddrinfo
> -getc_unlocked
> -getcwd
> -getdelim
> -getdomainname
> -getdtablesize
> -getegid
> -getenv
> -geteuid
> -getgid
> -getgrent
> -getgrent_r
> -getgrgid_r
> -getgrnam
> -getgrnam_r
> -getgrouplist
> -getgroups
> -gethostbyaddr_r
> -gethostbyname2
> -gethostbyname
> -gethostbyname_r
> -gethostent
> -gethostid
> -gethostname
> -getifaddrs
> -getline
> -getloadavg
> -getmntent
> -getmsg
> -getnameinfo
> -getnetbyaddr_r
> -getnetgrent_r
> -getopt
> -getopt_long
> -getopt_long_only
> -getpagesize
> -getpass
> -getpeername
> -getpgrp
> -getpid
> -getppid
> -getprotoent_r
> -getpwent
> -getpwent_r
> -getpwnam
> -getpwnam_r
> -getpwuid
> -getpwuid_r
> -getresuid
> -getrlimit
> -getrusage
> -getservbyname
> -getservbyname_r
> -getservbyport_r
> -getservent
> -getservent_r
> -getspnam
> -getspnam_r
> -gettimeofday
> -getttyent
> -getttynam
> -getuid
> -getusershell
> -getutent
> -getutid
> -getutline
> -getutmp
> -getutmpx
> -getutxent
> -getutxid
> -getutxline
> -getwd
> -getxattr
> -glob
> -gmtime
> -gmtime_r
> -grantpt
> -group_member
> -herror
> -hstrerror
> -iconv
> -iconv_open
> -if_freenameindex
> -if_indextoname
> -if_nameindex
> -if_nametoindex
> -index
> -inet_addr
> -inet_aton
> -inet_ntoa
> -inet_ntop
> -inet_pton
> -initgroups
> -innetgr
> -iruserok
> -isascii
> -isatty
> -isblank
> -isgraph
> -isinf
> -isnan
> -isprint
> -isspace
> -iswalnum
> -iswcntrl
> -iswctype
> -iswprint
> -iswspace
> -iswupper
> -isxdigit
> -kill
> -killpg
> -lchown
> -lckpwdf
> -lgetxattr
> -link
> -listxattr
> -llistxattr
> -localtime
> -localtime_r
> -lockf
> -lrand48
> -lsearch
> -lseek64
> -lsetxattr
> -lstat
> -mallinfo
> -malloc
> -mblen
> -mbrlen
> -mbrtowc
> -mbsinit
> -mbsrtowcs
> -mbtowc
> -memalign
> -memchr
> -memcmp
> -memcpy
> -memmove
> -mempcpy
> -memrchr
> -memset
> -mkdir
> -mkdirat
> -mkdtemp
> -mkfifo
> -mknod
> -mkstemp64
> -mkstemp
> -mktime
> -mlock
> -mmap
> -mtrace
> -munlock
> -munmap
> -nanosleep
> -nice
> -nl_langinfo
> -ntp_adjtime
> -ntp_gettime
> -_obstack_free
> -on_exit
> -open64
> -open
> -openat
> -opendir
> -openlog
> -pathconf
> -pipe
> -poll
> -popen
> -posix_memalign
> -prctl
> -pread
> -printf
> -__progname
> -pselect
> -pthread_mutex_lock
> -ptsname
> -putenv
> -putgrent
> -putpwent
> -putspent
> -pututline
> -pututxline
> -putwc
> -pwrite
> -qsort
> -raise
> -rand
> -random
> -rand_r
> -read
> -readdir
> -readdir_r
> -readlink
> -realloc
> -realpath
> -re_comp
> -recvmsg
> -re_exec
> -regcomp
> -regexec
> -remove
> -rename
> -re_search
> -rmdir
> -rpmatch
> -rresvport_af
> -ruserok
> -ruserok_af
> -sbrk
> -scandir
> -sched_setscheduler
> -sched_yield
> -__secure_getenv
> -select
> -semctl
> -semget
> -sendmsg
> -setbuf
> -setbuffer
> -setegid
> -setenv
> -seteuid
> -setgid
> -setgroups
> -sethostname
> -setitimer
> -_setjmp
> -setjmp
> -setlinebuf
> -setlocale
> -setmntent
> -setpgid
> -setpgrp
> -setpriority
> -setregid
> -setresgid
> -setresuid
> -setreuid
> -setrlimit
> -setsid
> -setsockopt
> -settimeofday
> -setuid
> -setutent
> -setutxent
> -setvbuf
> -setxattr
> -sgetspent
> -shmat
> -shmctl
> -shmdt
> -shmget
> -shutdown
> -sigaction
> -sigaddset
> -sigaltstack
> -sigblock
> -sigemptyset
> -sighold
> -siginterrupt
> -signal
> -sigprocmask
> -sigset
> -sigsetmask
> -sigstack
> -sigsuspend
> -sigvec
> -snprintf
> -socket
> -socketpair
> -sprintf
> -srand48
> -srand
> -srandom
> -sscanf
> -stat
> -statfs
> -statvfs
> -stime
> -stpcpy
> -strcasecmp
> -strcasestr
> -strchr
> -strchrnul
> -strcmp
> -strcspn
> -strdup
> -strerror
> -strerror_r
> -strftime
> -strlen
> -strncasecmp
> -strncmp
> -strndup
> -strnlen
> -strpbrk
> -strptime
> -strrchr
> -strsep
> -strsignal
> -strspn
> -strstr
> -strtod
> -strtoimax
> -strtok_r
> -strtol
> -strtoll
> -strtoul
> -strtoull
> -strtoumax
> -strverscmp
> -strxfrm
> -symlink
> -sync
> -sysconf
> -sysctl
> -sysinfo
> -syslog
> -_sys_siglist
> -sys_siglist
> -system
> -tcgetattr
> -tcgetpgrp
> -tcsetattr
> -tcsetpgrp
> -time
> -timegm
> -times
> -timezone
> -tmpnam
> -towlower
> -towupper
> -truncate
> -tsearch
> -ttyname
> -tzset
> -ulimit
> -umask
> -uname
> -unlink
> -unsetenv
> -unshare
> -updwtmp
> -updwtmpx
> -usleep
> -ustat
> -utime
> -utimes
> -utmpname
> -utmpxname
> -valloc
> -vasprintf
> -verrx
> -vfork
> -vfprintf
> -vfscanf
> -vhangup
> -vprintf
> -vsnprintf
> -vsprintf
> -wait3
> -wait4
> -waitpid
> -wcrtomb
> -wcscoll
> -wcsdup
> -wcslen
> -wctob
> -wctomb
> -wctype
> -wcwidth
> -wmemchr
> -wmemcpy
> -wmempcpy
> diff --git a/meta/recipes-core/glibc/site_config/headers b/meta/recipes-core/glibc/site_config/headers
> deleted file mode 100644
> index 69fedea4e1a..00000000000
> --- a/meta/recipes-core/glibc/site_config/headers
> +++ /dev/null
> @@ -1,155 +0,0 @@
> -aio.h
> -alloca.h
> -argz.h
> -arpa/inet.h
> -arpa/nameser.h
> -asm/byteorder.h
> -asm/ioctls.h
> -asm/page.h
> -asm/types.h
> -assert.h
> -byteswap.h
> -ctype.h
> -dirent.h
> -dlfcn.h
> -elf.h
> -endian.h
> -err.h
> -errno.h
> -execinfo.h
> -fcntl.h
> -features.h
> -float.h
> -fstab.h
> -ftw.h
> -getopt.h
> -glob.h
> -grp.h
> -iconv.h
> -ifaddrs.h
> -inttypes.h
> -langinfo.h
> -lastlog.h
> -libgen.h
> -libintl.h
> -limits.h
> -linux/capability.h
> -linux/fd.h
> -linux/fs.h
> -linux/hayesesp.h
> -linux/hdreg.h
> -linux/icmp.h
> -linux/in6.h
> -linux/joystick.h
> -linux/ptrace.h
> -linux/serial.h
> -linux/sonypi.h
> -linux/unistd.h
> -linux/utsname.h
> -linux/version.h
> -locale.h
> -malloc.h
> -math.h
> -mcheck.h
> -memory.h
> -mntent.h
> -mqueue.h
> -netdb.h
> -net/if.h
> -netinet/ether.h
> -netinet/in.h
> -netinet/ip6.h
> -netinet/ip.h
> -netinet/tcp.h
> -netinet/udp.h
> -netipx/ipx.h
> -net/route.h
> -paths.h
> -poll.h
> -pthread.h
> -pty.h
> -pwd.h
> -regex.h
> -resolv.h
> -rpc/rpc.h
> -rpc/types.h
> -sched.h
> -scsi/scsi.h
> -search.h
> -semaphore.h
> -setjmp.h
> -sgtty.h
> -shadow.h
> -signal.h
> -stdarg.h
> -stdbool.h
> -stdc
> -stddef.h
> -stdint.h
> -stdio.h
> -stdlib.h
> -string.h
> -strings.h
> -stropts.h
> -sys/bitypes.h
> -sys/cdefs.h
> -sys/dir.h
> -sys/epoll.h
> -sysexits.h
> -sys/fcntl.h
> -sys/file.h
> -sys/fsuid.h
> -sys/ioctl.h
> -sys/ipc.h
> -syslog.h
> -sys/mman.h
> -sys/mount.h
> -sys/mtio.h
> -sys/param.h
> -sys/poll.h
> -sys/prctl.h
> -sys/ptrace.h
> -sys/queue.h
> -sys/reg.h
> -sys/resource.h
> -sys/select.h
> -sys/sem.h
> -sys/shm.h
> -sys/signal.h
> -sys/socket.h
> -sys/socketvar.h
> -sys/soundcard.h
> -sys/statfs.h
> -sys/stat.h
> -sys/statvfs.h
> -sys/stropts.h
> -sys/swap.h
> -sys/sysctl.h
> -sys/sysinfo.h
> -sys/sysmacros.h
> -sys/termios.h
> -sys/timeb.h
> -sys/time.h
> -sys/times.h
> -sys/timex.h
> -sys/types.h
> -sys/uio.h
> -sys/un.h
> -sys/unistd.h
> -sys/user.h
> -sys/utsname.h
> -sys/vfs.h
> -sys/wait.h
> -termio.h
> -termios.h
> -time.h
> -ttyent.h
> -ulimit.h
> -unistd.h
> -ustat.h
> -utime.h
> -utmp.h
> -utmpx.h
> -values.h
> -wchar.h
> -wctype.h
> diff --git a/meta/recipes-core/glibc/site_config/types b/meta/recipes-core/glibc/site_config/types
> deleted file mode 100644
> index 178bd85a00b..00000000000
> --- a/meta/recipes-core/glibc/site_config/types
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -char
> -char *
> -double
> -float
> -int
> -long
> -long double
> -long int
> -long long
> -long long int
> -short
> -short int
> -signed char
> -unsigned char
> -unsigned int
> -unsigned long
> -unsigned long int
> -unsigned long long int
> -unsigned short
> -unsigned short int
> -void *
> --
> 2.19.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH 1/4] glibc: Remove site_config and glibc-initial
  2018-12-20 11:50 ` [PATCH 1/4] glibc: Remove site_config and glibc-initial Burton, Ross
@ 2018-12-20 11:58   ` richard.purdie
  2018-12-20 13:02     ` Burton, Ross
  0 siblings, 1 reply; 15+ messages in thread
From: richard.purdie @ 2018-12-20 11:58 UTC (permalink / raw)
  To: Burton, Ross, Mark Hatle; +Cc: OE-core

On Thu, 2018-12-20 at 11:50 +0000, Burton, Ross wrote:
> As the only users of siteconfig are now zlib and ncurses, should we
> just rip it out entirely leaving a gap for a fresh implementation?

I'm cc'ing Mark who has a lot of the history on this.

I think we're at a point where we likely need to re-implement this in a
different way...

Cheers,

Richard


> Ross
> On Thu, 20 Dec 2018 at 00:16, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > The only reason we appear to need glibc-initial at this time is to
> > support
> > the site_config code. The site_config code compiles and therefore
> > needs
> > at least some level of working C library to link against.
> > 
> > This isn't a good reason to keep the complexity of glibc-initial
> > around
> > so remove it, and the site_config support which then breaks.
> > 
> > Performance benchmarks suggest the time spent just rerunning
> > configure
> > for site_config just about equals any performance benefit for OE-
> > Core
> > image builds excluding the time spent adding glibc-initial to the
> > dependency chain.
> > 
> > I'm not opposed to readding some other form of site_config support
> > but it needs to be rethought.
> > 
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>



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

* Re: [PATCH 1/4] glibc: Remove site_config and glibc-initial
  2018-12-20 11:58   ` richard.purdie
@ 2018-12-20 13:02     ` Burton, Ross
  2018-12-20 18:01       ` Mark Hatle
  0 siblings, 1 reply; 15+ messages in thread
From: Burton, Ross @ 2018-12-20 13:02 UTC (permalink / raw)
  To: Purdie, Richard; +Cc: OE-core

On Thu, 20 Dec 2018 at 11:59, <richard.purdie@linuxfoundation.org> wrote:
> On Thu, 2018-12-20 at 11:50 +0000, Burton, Ross wrote:
> > As the only users of siteconfig are now zlib and ncurses, should we
> > just rip it out entirely leaving a gap for a fresh implementation?
>
> I'm cc'ing Mark who has a lot of the history on this.
>
> I think we're at a point where we likely need to re-implement this in a
> different way...

I did some poking at this a few weeks ago, basically turned off
siteconfig by removing the 'inherit siteconfig' from
autotools.bbclass.

Interestingly, at the time for core-image-minimal this actually
resulted in the build being faster.  Some recipes were a little slower
to configure, specifically coreutils had the biggest slowdown as it
appears to probe for every syscall in the world (via gnulib) but that
only took seven seconds longer.  However, as the siteconfig generation
is done by writing a custom configure.ac and then doing the
autoconf/configure dance, these slowdowns were balanced out by glibc
taking an extra 30 seconds.

It appears that disabling siteconfig for glibc is an acceptable
compromise if we can not build glibc and gcc twice.

Ross


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

* Re: [PATCH 1/4] glibc: Remove site_config and glibc-initial
  2018-12-20 13:02     ` Burton, Ross
@ 2018-12-20 18:01       ` Mark Hatle
  2018-12-20 19:47         ` Burton, Ross
  2018-12-20 19:50         ` Burton, Ross
  0 siblings, 2 replies; 15+ messages in thread
From: Mark Hatle @ 2018-12-20 18:01 UTC (permalink / raw)
  To: Burton, Ross, Purdie, Richard; +Cc: OE-core

On 12/20/18 7:02 AM, Burton, Ross wrote:
> On Thu, 20 Dec 2018 at 11:59, <richard.purdie@linuxfoundation.org> wrote:
>> On Thu, 2018-12-20 at 11:50 +0000, Burton, Ross wrote:
>>> As the only users of siteconfig are now zlib and ncurses, should we
>>> just rip it out entirely leaving a gap for a fresh implementation?
>>
>> I'm cc'ing Mark who has a lot of the history on this.
>>
>> I think we're at a point where we likely need to re-implement this in a
>> different way...

I do think it's still needed/desired.  However, I absolutely agree we need to
rethink/reimplement the generation aspect of the site-config part.

> I did some poking at this a few weeks ago, basically turned off
> siteconfig by removing the 'inherit siteconfig' from
> autotools.bbclass.
> 
> Interestingly, at the time for core-image-minimal this actually
> resulted in the build being faster.  Some recipes were a little slower
> to configure, specifically coreutils had the biggest slowdown as it
> appears to probe for every syscall in the world (via gnulib) but that
> only took seven seconds longer.  However, as the siteconfig generation
> is done by writing a custom configure.ac and then doing the
> autoconf/configure dance, these slowdowns were balanced out by glibc
> taking an extra 30 seconds.
> 
> It appears that disabling siteconfig for glibc is an acceptable
> compromise if we can not build glibc and gcc twice.

glibc is something we've never been concerned with 'doing the wrong thing'.
It's also very possible that we could use glibc's autoconf output as a basis for
the site-config items.

Before the way the system worked is that it tried to determine the 'stupid
defaults(*)' that autoconf is always looking for, as well as many of the
syscalls/headers that are common.

As far as zlib/ncurses being the only things that augmented them, when this was
originally implemented many years ago -- those items were the most commonly used
by other configure scripts.  So adding those defaults when zlib and/or ncurses
was provided by the system offered a measurable difference in the performance of
configure.

We expected over time additional things would be added (but obviously they never
were).  Stuff like gnome, glib, etc...


So my recommendation is that the siteconfig is something (new recipe) that
either runs right after the system libc (and everything else depends on that
uses autoconf) -- or runs at the end of the libc command.

The goal of this is to provide a core set of system wide definitions in a way we
know will produce a consistent set for any autoconf user.  (If other systems,
like cmake could make use of this type of thing -- it's something to consider as
well.)

We also still want a way that manual definitions can be setup on a global basis
for a given architecture.  (We do want these limited for the most part, since
maintenance is overlooked -- but we've certainly seen cases in the past where
configure works like this:  Yes, No, Cross -- where cross defines 'No' and never
checks.   This functions, but ends up in a significantly less optimized
situation, and these are incredibly difficult to identify.  [Using QEMU isn't an
option, as QEMU doesn't know -all- potential architectures...]

* stupid defaults - sizeof char, short, int, long, void, long long, etc...


Anyway, my 2 cents.  I'd like to see how this goes with it stripped out for the
next few weeks.. and I'll back back early January where we can evaluate my
assumptions/experiences above and see how this tracks with current reality.

--Mark

> Ross
> 



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

* Re: [PATCH 1/4] glibc: Remove site_config and glibc-initial
  2018-12-20 18:01       ` Mark Hatle
@ 2018-12-20 19:47         ` Burton, Ross
  2018-12-20 19:50         ` Burton, Ross
  1 sibling, 0 replies; 15+ messages in thread
From: Burton, Ross @ 2018-12-20 19:47 UTC (permalink / raw)
  To: Mark Hatle; +Cc: OE-core

On Thu, 20 Dec 2018 at 18:02, Mark Hatle <mark.hatle@windriver.com> wrote:
> We also still want a way that manual definitions can be setup on a global basis
> for a given architecture.  (We do want these limited for the most part, since
> maintenance is overlooked -- but we've certainly seen cases in the past where
> configure works like this:  Yes, No, Cross -- where cross defines 'No' and never
> checks.   This functions, but ends up in a significantly less optimized
> situation, and these are incredibly difficult to identify.  [Using QEMU isn't an
> option, as QEMU doesn't know -all- potential architectures...]

These are absolutely not going away, and I've even got a patch locally
that can make autoconf throw a warning if it uses a hard-coded guess
when its cross-compiling.  The output is shocking...

eg this is why our Python wasn't actually capable of doing floating
point math properly: it was using runtime tests to determine bit
order, and fell back to "don't know", and floating emulation in
software.  I fixed this upstream to just look at bit order in a
binary, so the test is faster and works in cross.

Since the early days of siteconfig though a lot has changed in
autoconf.  It can do sizeof() without running, for a start.  It's a
lot faster in general, so I really do think that the usefulness of
siteconfig is really limited, especially considering how fragile it is
if you actually use it.

Ross


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

* Re: [PATCH 1/4] glibc: Remove site_config and glibc-initial
  2018-12-20 18:01       ` Mark Hatle
  2018-12-20 19:47         ` Burton, Ross
@ 2018-12-20 19:50         ` Burton, Ross
  2018-12-21  2:22           ` Mark Hatle
  1 sibling, 1 reply; 15+ messages in thread
From: Burton, Ross @ 2018-12-20 19:50 UTC (permalink / raw)
  To: Mark Hatle; +Cc: OE-core

On Thu, 20 Dec 2018 at 18:02, Mark Hatle <mark.hatle@windriver.com> wrote:
> As far as zlib/ncurses being the only things that augmented them, when this was
> originally implemented many years ago -- those items were the most commonly used
> by other configure scripts.  So adding those defaults when zlib and/or ncurses
> was provided by the system offered a measurable difference in the performance of
> configure.

Do you know what the zlib and ncurses siteconfig files were doing?
Just short-circuiting the AC_CHECK_HEADER call, which is basically
stat(includedir + header.h).  I'd call that the definition of
premature optimisation. :)

Ross


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

* Re: [PATCH 1/4] glibc: Remove site_config and glibc-initial
  2018-12-20 19:50         ` Burton, Ross
@ 2018-12-21  2:22           ` Mark Hatle
  2018-12-21  6:54             ` Yang, Liezhi
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Hatle @ 2018-12-21  2:22 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 12/20/18 1:50 PM, Burton, Ross wrote:
> On Thu, 20 Dec 2018 at 18:02, Mark Hatle <mark.hatle@windriver.com> wrote:
>> As far as zlib/ncurses being the only things that augmented them, when this was
>> originally implemented many years ago -- those items were the most commonly used
>> by other configure scripts.  So adding those defaults when zlib and/or ncurses
>> was provided by the system offered a measurable difference in the performance of
>> configure.
> 
> Do you know what the zlib and ncurses siteconfig files were doing?
> Just short-circuiting the AC_CHECK_HEADER call, which is basically
> stat(includedir + header.h).  I'd call that the definition of
> premature optimisation. :)

In the original AC_CHECK_HEADER stuff, it was more then just a simple stat.  The
system would compile a small executable that included the header and then
attempted to execute a pass/fail -- or in the cross compile case would do
something with the output binary.

This very well may have changed from a compilation step to a simple stat in
configure in the the last 4 or 5 years.  It's that compilation/execution step
(both that and the various sizeof) that were hideously slow in the original
implementation and being avoided by the special contents.

The assumption we were making of course was that zlib, ncurses (or anything
else) actually worked with those headers.. so we skipped the compilation and
just did a stat based on the headers to fill things out.

The systems that did the sizeof and header identification in the site-config
bbclass were written to do things in a dynamic way so that if the system
behavior changed we wouldn't have incorrect defaults "until someone noticed".

The behavior of using the compiler to identify a sizeof and using tools to
return the result is actually very efficient -- but does require a functioning
compiler (and headers).  If I remember correctly, we're not fully compiling, but
putting out an intermediate object which we can then query for the values of the
various pieces.  (In one iteration at least, we processed all of the sizeof in a
single pass making it even more efficient.)

--Mark

> Ross
> 



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

* Re: [PATCH 1/4] glibc: Remove site_config and glibc-initial
  2018-12-21  2:22           ` Mark Hatle
@ 2018-12-21  6:54             ` Yang, Liezhi
  0 siblings, 0 replies; 15+ messages in thread
From: Yang, Liezhi @ 2018-12-21  6:54 UTC (permalink / raw)
  To: Hatle, Mark; +Cc: OE-core

Hi Randy,

Sorry, I am OOO today, will do it next week.
BTW, I have looked into siteconfig and siteinfo recently, and have some crazy ideas on them, which seems can save a lot of configure time, I will try to send them out next week.

// Robert

Sent from mobile phone

> 在 2018年12月21日,10:22,Mark Hatle <mark.hatle@windriver.com> 写道:
> 
>> On 12/20/18 1:50 PM, Burton, Ross wrote:
>>> On Thu, 20 Dec 2018 at 18:02, Mark Hatle <mark.hatle@windriver.com> wrote:
>>> As far as zlib/ncurses being the only things that augmented them, when this was
>>> originally implemented many years ago -- those items were the most commonly used
>>> by other configure scripts.  So adding those defaults when zlib and/or ncurses
>>> was provided by the system offered a measurable difference in the performance of
>>> configure.
>> 
>> Do you know what the zlib and ncurses siteconfig files were doing?
>> Just short-circuiting the AC_CHECK_HEADER call, which is basically
>> stat(includedir + header.h).  I'd call that the definition of
>> premature optimisation. :)
> 
> In the original AC_CHECK_HEADER stuff, it was more then just a simple stat.  The
> system would compile a small executable that included the header and then
> attempted to execute a pass/fail -- or in the cross compile case would do
> something with the output binary.
> 
> This very well may have changed from a compilation step to a simple stat in
> configure in the the last 4 or 5 years.  It's that compilation/execution step
> (both that and the various sizeof) that were hideously slow in the original
> implementation and being avoided by the special contents.
> 
> The assumption we were making of course was that zlib, ncurses (or anything
> else) actually worked with those headers.. so we skipped the compilation and
> just did a stat based on the headers to fill things out.
> 
> The systems that did the sizeof and header identification in the site-config
> bbclass were written to do things in a dynamic way so that if the system
> behavior changed we wouldn't have incorrect defaults "until someone noticed".
> 
> The behavior of using the compiler to identify a sizeof and using tools to
> return the result is actually very efficient -- but does require a functioning
> compiler (and headers).  If I remember correctly, we're not fully compiling, but
> putting out an intermediate object which we can then query for the values of the
> various pieces.  (In one iteration at least, we processed all of the sizeof in a
> single pass making it even more efficient.)
> 
> --Mark
> 
>> Ross
>> 
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

end of thread, other threads:[~2018-12-21  6:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20  0:15 [PATCH 1/4] glibc: Remove site_config and glibc-initial Richard Purdie
2018-12-20  0:15 ` [PATCH 2/4] gcc: Drop gcc-cross-initial and use gcc-cross instead Richard Purdie
2018-12-20  0:55   ` Khem Raj
2018-12-20 10:41     ` richard.purdie
2018-12-20  0:15 ` [PATCH 3/4] gcc: Drop the -initial versions of the compiler Richard Purdie
2018-12-20  0:15 ` [PATCH 4/4] recipes: Drop virtual/libc-for-gcc Richard Purdie
2018-12-20  0:33 ` ✗ patchtest: failure for "glibc: Remove site_config and ..." and 3 more Patchwork
2018-12-20 11:50 ` [PATCH 1/4] glibc: Remove site_config and glibc-initial Burton, Ross
2018-12-20 11:58   ` richard.purdie
2018-12-20 13:02     ` Burton, Ross
2018-12-20 18:01       ` Mark Hatle
2018-12-20 19:47         ` Burton, Ross
2018-12-20 19:50         ` Burton, Ross
2018-12-21  2:22           ` Mark Hatle
2018-12-21  6:54             ` Yang, Liezhi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.