NetBSD-Bugs archive

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

Re: toolchain/50961: cross compiling evbarm tools on Darwin 8 PowerPC fails



The following reply was made to PR toolchain/50961; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: toolchain/50961: cross compiling evbarm tools on Darwin 8 PowerPC fails
Date: Tue, 17 May 2016 07:59:44 +0700

     Date:        Sun, 15 May 2016 16:10:01 +0000 (UTC)
     From:        Sevan Janiyan <venture37%geeklan.co.uk@localhost>
     Message-ID:  <20160515161001.3B45B7AAAF%mollari.NetBSD.org@localhost>
 
   |  As a hack I excluded Apple from the if statement which defines 
   |  ELFTC_VCSID(ID) to __asm__(".ident\t\"" ID "\"") and I was able to build 
   |  the cross-compile toolchain on Darwin 8 PowerPC without issue, will see 
   |  if v9 has any issues before proposing an amendment to the if statement.
 
 I am not sure what the underlying issue or problem is here, but this ...
 
   |  -#if defined(__APPLE__) || defined(__GLIBC__) || defined(__GNU__) || \
   |  +#if !defined(__APPLE__) || defined(__GLIBC__) || defined(__GNU__) || \
   |        defined(__linux__)
 
 is certainly not the correct fix.
 
 Before the change the #if block would be executed if any of APPLE GLIBC
 GNU or linux were defined (ignoring the __'s for simplicity here.)
 
 After the change, the #if block will be executed if any of GLIBC GNU or linux
 are defined, and also on all systems where APPLE is not defined.
 
 That's not going to be what you intended I expect.
 
 Delete the "defined(__APPLE__) ||" completely, if the objective is for the
 #if block to be excluded on all apple (Darwin I guess this means) systems,
 unless one of the other 3 symbols is defined (which I assume in environments
 where it matters they will not be, or your change would have changed nothing.)
 
 If you don't want the block on any APPLE systems regardless of GLIBC GNU or
 linux (which is unlikely, especially if it is linux, on a x86 Mac), then
 delete the defined(_APPLE__) and add a new #if !defined(__APPLE)/#endif
 block inside, or outside
 
 More likely though you want to just exclude powerpc Apple, in which case
 you might want something more like
 
 #if	( defined(__APPLE__) && ! however_one_tests_for_PowerPC ) || ...
 
 of if it is not to be used on any PowerPC regardless of manufacturer
 
 #if	! however_one_tests_for_PowerPC && ( defined(__APPLE__) || .... )
 
 But first you need to know exactly what the issue is, and the environment(s)
 in which you need to include or exclude that Makefile block.
 
 kre
 


Home | Main Index | Thread Index | Old Index