Simon Gerraty | 16 May 2013 20:40
Favicon

make: wilcard targets and .PHONY

Back in 2000, the callpath through Suff_FindDeps was skipped for .PHONY
targets.
It turns out though that that is the only place where wildcard targets
are expanded.
Assuming there is something in ./sub/ the makefile:

.MAIN: all
all: subs

SUBS= sub/*
subs:	${SUBS}
	 <at> echo yay ${SUBS}

.ifdef PHONY
.PHONY: subs
.endif

works so long as PHONY isn't defined.

The patch below (sans fixing the indentation) pushes the PHONY check
lower so that wildcards can be expanded correctly, while still skipping 
most of the suffix related effort.

Index: suff.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/suff.c,v
retrieving revision 1.69
diff -u -p -r1.69 suff.c
--- suff.c	29 Sep 2011 23:38:04 -0000	1.69
+++ suff.c	16 May 2013 18:34:29 -0000
(Continue reading)

Emmanuel Dreyfus | 25 Mar 2013 18:45
Picon

Missing sysinst/sysinstmsgs.*

Hi

When I build netbsd-6 using build.sh -Uuom i386 release, I get an error
because of missing
src/distrib/i386/ramdisks/ramdisk-big/sysinst/sysinstmsgs.es
Other sysinstmsgs.* are missing as well.

Is there anything wrong with that build.sh usage?

--

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu <at> netbsd.org

Edgar Fuß | 15 Mar 2013 21:49
Picon
Favicon

netbsd-6 build failure

Running an unpriviledged build of a current netbsd-6 source tree fails with

======  3 missing files in DESTDIR  ========
Files in flist but missing from DESTDIR.
File wasn't installed ?
------------------------------------------
./usr/share/zoneinfo/Asia/Khandyga
./usr/share/zoneinfo/Asia/Ust-Nera
./usr/share/zoneinfo/Europe/Busingen
========  end of 3 missing files  ==========
*** [checkflist] Error code 1

I'm not sure whether this is the right place to report this.

Nicolas Joly | 11 Mar 2013 20:54
Picon
Picon
Favicon

Unnoticed host-mkdep failure with binstall


Hi,

While trying to update my -current amd64 workstation, i luckily found
a non-fatal(?) error while early building binstall ...

dependall ===> binstall
     create  binstall/getid.d
     create  binstall/xinstall.d
In file included from /local/src/NetBSD/src/tools/binstall/../../usr.bin/xinstall/xinstall.c:77:0:
/local/src/NetBSD/src/tools/binstall/../compat/sys/sha1.h:4:27: fatal error: nbtool_config.h:
No such file or directory
compilation terminated.
     create  binstall/.depend
    compile  binstall/xinstall.lo
    compile  binstall/getid.lo
       link  binstall/xinstall
xinstall.lo: In function `do_symlink':
xinstall.c:(.text+0x604): warning: warning: mktemp() possibly used unsafely,use mkstemp() or mkdtemp()

Looks like host_mkdep tool does not return a non zero status upon
error, letting build continue :

#    create  binstall/xinstall.d
/local/src/NetBSD/src/tools/host-mkdep/obj.amd64/host-mkdep -f xinstall.d  --    
-I/local/src/NetBSD/src/tools/binstall/../compat/sys
-DTARGET_STRIP=\"/local/src/NetBSD/tool/bin/x86_64--netbsd-strip\"-I/local/src/NetBSD/src/usr.sbin/mtree
 /local/src/NetBSD/src/tools/binstall/../../usr.bin/xinstall/xinstall.c
In file included from /local/src/NetBSD/src/tools/binstall/../../usr.bin/xinstall/xinstall.c:77:0:
/local/src/NetBSD/src/tools/binstall/../compat/sys/sha1.h:4:27: fatal error: nbtool_config.h:
(Continue reading)

Anthony Mallet | 9 Mar 2013 16:14
Picon
Picon
Favicon

g++ -pedantic on 6.0.1/amd64 fails to include xmmintrin.h

Hi,

To make a long story short, the following definitions of posix_memalign() seem
to conflict in pedantic g++ mode, on a stock NetBSD-6.0.1/amd64:

In /usr/include/gcc-4.5/mm_malloc.h:
  extern "C" int posix_memalign (void **, size_t, size_t) throw ();
In /usr/include/stdlib.h:
  int      posix_memalign(void **, size_t, size_t);

Not sure who to blame here :) Should I open a PR for this, or is this more a
gcc issue?

Here is how to reproduce the problem:
fluffy64-netbsd6[~] > cat mm_malloc.c 
#include <xmmintrin.h>

int
main()
{
  return 0;
}
fluffy64-netbsd6[~] > g++ -pedantic ~/mm_malloc.c
In file included from /usr/include/gcc-4.5/xmmintrin.h:39:0,
                 from /home/mallet/mm_malloc.c:1:
/usr/include/gcc-4.5/mm_malloc.h:34:64: error: declaration of 'int posix_memalign(void**,
size_t, size_t) throw ()' throws different exceptions
/usr/include/stdlib.h:237:6: error: from previous declaration 'int posix_memalign(void**, size_t, size_t)'

(Continue reading)

Edgar Fuß | 22 Jan 2013 18:00
Picon
Favicon

make .ORDER

Is there a sane way to have target A built before target B without having 
B depend on A? Is .ORDER A B guaranteed to do that? The description of .ORDER 
says "The ordering imposed by .ORDER is only relevant for parallel makes." 
Does that mean it only imposes the ordering restrictions for parallel makes 
or the author of the manpage couldn't think of an example other that parallel 
makes where you will want a particular order without a dependency?

In my case, A is a directory containing B. The rules for A install -d and 
the rules for B install /dev/null. With B depending on A, B will be wiped out 
whenever you touch another file in directory A.

Probably there's a more elegant way to acheive the same thing.

Simon Gerraty | 18 Jan 2013 19:01
Favicon

make: Check_Cwd_av handle -C or remove?

I added the Check_Cwd_av logic at least 10 years ago, to avoid the need
to fix lots of makefiles which didn't work with MAKEOBJDIRPREFIX.

I suspect the need for it has passed.
Building with separate obj trees (via MAKEOBJDIRPREFIX etc), seems
almost universal now.
Perhaps it is time to retire this check or perhaps disable it by
default?

Anyway, the patch below teaches it to spot 'make -C somewhere' as the
equivalent of 'cd somewhere && make'.
I limited the check of make args to some small number, since I at least
tend to make -C one of the 1st args, and it is rare
that an extra 'cd ${.CURDIR}' will do harm.
Setting MAKE_CHECK_CWD_ARGS to 0 would check them all.

--sjg

Index: main.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/main.c,v
retrieving revision 1.203
diff -u -p -r1.203 main.c
--- main.c	31 Aug 2012 07:00:36 -0000	1.203
+++ main.c	18 Jan 2013 17:58:02 -0000
 <at>  <at>  -1406,6 +1406,11  <at>  <at>  found:
  */
 static int  Check_Cwd_Off = 0;

+/* Limit the number of args to make we check for -C */
(Continue reading)

Hubert Feyrer | 13 Jan 2013 01:27
Picon
Favicon

debugging early failure of build.sh (in rebuilding nbmake)


I'm trying a crossbuild of NetBSD-current/amd64 on a NetBSD 6.0/i386 host, 
and get:

 	...
 	===> Bootstrapping nbmake
 	checking for sh... /bin/sh
 	checking for gcc... cc
 	checking for C compiler default output... configure: error: C compiler 	cannot create executables
 	ERROR: Configure of nbmake failed
 	*** BUILD ABORTED ***

Not very useful. Digging and chopping to get at config.log (and ignoring 
what the error for this was, for a second), I wonder if we should print 
the nbmake configure's config.log if we detect an error.

The patch below does this for me. Any comments?

  - Hubert

Index: build.sh
===================================================================
RCS file: /cvsroot/src/build.sh,v
retrieving revision 1.260
diff -u -r1.260 build.sh
--- build.sh    2 Dec 2012 19:19:36 -0000       1.260
+++ build.sh    13 Jan 2013 00:15:07 -0000
 <at>  <at>  -1454,7 +1454,9  <at>  <at> 
                 ${runcmd} env CC="${HOST_CC-cc}" 
CPPFLAGS="${HOST_CPPFLAGS}" \
(Continue reading)

Thomas Klausner | 12 Jan 2013 18:52
Picon

libfl.a -> libfl.so?

Hi!

When linking a shared library with libtool against libfl.a it
complains:

*** Warning: linker path does not have real file for library -lfl.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libfl and none of the candidates passed a file format test
*** using a regex pattern. Last file checked: /usr/lib/libfl.a

Is there a reason we don't provide a libfl.so?

Or should I call libtool differently?
 Thomas

Martin Husemann | 15 Dec 2012 14:09
Picon

mknative broken?

Is anyone able to run any variant of mknative in -current?
It seems broken to me, maybe due to the recent tool/objdir changes?

When calling the "getvars" shell function it passes a relative name of a
Makefile to the function, which then seems to resolve that locally to some
directory deep inside $OBJDIR, but there (of course) no makefile of that
name exists.

Martin

Christoph Egger | 13 Dec 2012 16:14
Picon
Picon

libgmp: duplicate symbol


Hi,

when building tools for NetBSD/amd64 on Mac OSX 10.5 configure for mpfr
fails with:

[...]
checking dynamic linker characteristics... darwin9.8.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether gcc __attribute__ ((mode (XX))) works... yes
checking for recent GMP... yes
checking for __gmpz_init in -lgmp... no
configure: error: libgmp not found or uses a different ABI.
Please read the INSTALL file -- see "In case of problem".
*** [.configure_done] Error code 1

Looking into the config.log I find this error:

ld: duplicate symbol ___gmpz_abs in
build/tooldir.amd64/lib/libgmp.a(memory.o) and
build/tooldir.amd64/lib/libgmp.a(lt22-init.o)

Attached is a fix. Please review.

Christoph
(Continue reading)


Gmane