tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Failure to cross-build libstdc++-v3 for earmv6hf from macOS




> On Apr 7, 2018, at 7:55 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:
> 
> At first glance, what’s happening is that libstdc++-symbols.ver ends up as an empty file, because c++config.h fails to preprocess due to missing <bits/os_defines.h>.  In fact, it seems like all of the <bits/…> headers are missing, though I might just be confused about where to look (this GNU toolchain stuff seems even more spaghetti-like these days than it used to be).

Sorry, I was wrong about this… it appears to be a problem with grep(1) on the cross-host.  If I do just a snippet of the command that builds the version map:

BigMac:thorpej$ cat /Volumes/Data0/Users/thorpej/hack/NetBSD/current/src/external/gpl3/gcc/dist/libstdc++-v3/config/abi/pre/gnu.ver  |  grep -E -v '^[     ]*#(#| |)'
grep: empty (sub)expression
BigMac:thorpej$ 

…but isn’t grep(1) supposed to be a host tool to avoid weird problems like this?

# grep exists in src/tools, but is not hooked up into the build.
#TOOL_GREP=             ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
TOOL_GREP=              grep

Well that’s a bummer.  I notice that NetBSD seems to be shipping GNU grep(1) these days as well (???):

nixie-dev# uname -a; grep --version
NetBSD nixie-dev 8.99.12 NetBSD 8.99.12 (thorpej-RPI-NixieClock) #1: Fri Apr  6 12:34:23 PDT 2018  thorpej@BigMac.local:/Volumes/Data0/Users/thorpej/hack/NetBSD/current/src/sys/arch/evbarm/compile/thorpej-RPI-NixieClock evbarm
grep (GNU grep) 2.5.1a nb1

Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

nixie-dev#

macOS is not using GNU grep(1), so maybe there’s some subtle behavioral difference that this expression depends on?

If I change the expression to:

	grep -E -v '^[     ]*#’

…the macOS grep(1) does not error out and it produces the same output as the GNU grep(1) on NetBSD (both versions of the expression).

— thorpej



Home | Main Index | Thread Index | Old Index