(for booth the tool build and mknative). gcc's "config.gcc" sets
it if the target is netbsd[2-9], but since the target is w/o version
number in our builds, it has no effect. Found by Nick Hudson,
patch approved by mrg.
This is adapted from the very detailed fix provided by
Giles Lean in PR bin/36678.
Only one simplified implementation is provided, instead of the
two implementations conditional on __GNUC_PREREQ__(2,95) that are
provided in NetBSD's <sys/endian.h>. The use of memcpy instead of
__builtin__memcpy, and the absence of __inline or __unused, should make
it independent of GCC.
and not /usr/bin/strip. This makes nbinstall usable for
cross-compiling in pkgsrc.
- Fix a typo in a comment.
- Fix strip() in the context of (v)fork:
- Build the argument string first using asprintf (simpler) and
avoid leaking memory from the child in the parent.
- Don't use warn in the child, as stdio should be avoided.
OK christos@, tested on Solaris by dmcmahill@.
has ssp functions built-in" test via the TARGET_LIBC_PROVIDES_SSP environment
variable, to allow us to configure a cross-compiler appropriately without
having to try to find out by looking in the target's source directory.
Tweak our build to tell gcc that the ssp bits are now in libc.
The native compiler appears to already think that the ssp bits
live in libc, so no change appears to be needed there.
The autoconf-generated configure script will be committed separately shortly.
flag. This ensures that -j<N> isn't accidentally inherited from the
environment, because the "--- foo ---" headers printed with -j<N> would
interfere with parsing the output.
bin/ls sources to libutil:
o Bump libutil minor version number
o Fix uses to include <util.h> to pick up the function definitions
o Fix most uses of flags_to_string() to release the now-malloc()ed result
where ${MAKEWRAPPERMACHINE} is the suffix XXX on the target's make
wrapper, nbmake-XXX.
Fixes toolchain/30673, "single arch host disklabel isn't enough".
default is to enable sim if there's support for the cpu).
The current list of "known to work" contains arches with G_SIM_OBS
already set: powerpc, powerpc64 and mips.
There's arm support in sim, but committed configs for arm do not have
G_SIM_OBS set, so I'm not enabling it here.
There's SH support in sim, but it fails to build out of the box, and
since we didn't build SH sim support for gdb 5.3, we keep it disabled.
Other arches shouldn't be affected, as there's no support for them in sim.
top-level configure, but to ${MAKE} configure-host as well.
Add more vars (for readline mostly) so that there's no configure
warnings about tests skipped b/c of cross-compilation.
gdb comes with its own copy of GNU readline 5.x, but
-I${DESTDIR}/usr/include stuffed at the beginning of the command line
makes it find our compat readline/readline.h (emulating readline 2.x)
that conflicts with the readline 5.x includes.
Makes README.mknative instructions actually work instead of failing
midway b/c of conflicting tilde_expand() prototypes.
Remove a 'never had a sane effect' .WAIT from a .ORDER line.
Don't add a (probably incorrect) dependency for 'make install' since
it contradicts a .ORDER line elsewhere when .ORDER applies recursively
to child nodes.
I also think that the stuff that tries to add dependencies between
the stuff that bsd.subdir.mk generates does not DTRT at all.
I suspect that build.sh builds things in an order that avoids issues here.
pick up tools/gettext that is built when MKMAINTAINERTOOLS=yes
As gettext is built after gmake - this only happens if you either do
an update build and tools/gmake gets rebuilt, or if you use the same
TOOLDIR for several ports.
than "sh" for executing commands. Useful in a cross-build environment.
* Do not define _PATH_BSHELL, because it is no longer used by make.
* In addition to _PATH_DEFSHELLDIR (the directory in which the default
shell can be found), define _BASENAME_DEFSHELL (the shell's basename).
* Use shell builtin string manipulation instead of sed to extract
the directory name and basename from $BSHELL.
OK sjg, christos
is busted in some way.
The TOOL_SED doesn't use TIOCGWINSIZE, and has some changes to include
nbtool_config.h in a cross build environment.
Combined with some other changes (not yet committed), this allows cross
compiling m68k code on Solaris 10/amd64.
- get the information from a gcc3 .native
- don't get gcc4 variables
- put back the getvars for SHLIB_LINK SHLIB_MULTILIB as they work
on gcc3 and leave as XXX'd on gcc4.
I've re-arranged some of the variables to minimise the differences, but
didn't do them all.
'make clean; make' failed in tools because necessary configure generated
files were removed. The failure manifested itself with string_to_flags
being undefined in binstall.
- look in gnu/dist/gcc4
- don't build fortran
- use /usr/bin/env -i so that gmake works (XXX - breaks from MAKEFLAGS
in the build.sh generated makewrapper.)
- use gmake and Makefile.gmakehost
- update .native/.configure_done target
work on all currently supported netbsd build hosts.
XXX current issues:
XXX - calls /usr/bin/env -i directly, mostly to wipe-out MAKEFLAGS
XXX from the environment (usually set by the buildwrapper to
XXX "-de -m <path-to>/share/mk"
1. #undef d_fileno, which is set by Darwin's <dirent.h>,
and which clashes with d_fileno in NetBSD headers.
2. Install the sys/ufs/ header files in nbinclude/ in order
to override Darwin's own, incompatible header files.
split off the autogenerated file into nbtool_config_internal.h,
and let nbtool_config.h be a file with the proper wrappers.
This way you can just change configure.ac, run autoconf and autoheader,
verify the result, and commit, but don't have to edit nbtool_config*in
manually every time.
it's (more) consistent in the tree; this, along with changing tools/compat's
autoconf detection from AC_CHECK_FUNCS to AC_CHECK_DECLS makes the vast
majority of htobe16 and friends' redefinition errors bite the dust.
Tested with -current and FreeBSD.
under HAVE_NBTOOL_CONFIG_H for disktab.h as well. This means
disktab.h has to be installed in the nbinclude include directory.
(Failure mode: with TOOLDIR as a subdirectory of /usr, the host's disktab.h
got picked up, and not the in-tree copy.)
Reviewed by dyoung.
and install ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-disklabel,
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk by "reaching over" to
the sources in ${NETBSDSRCDIR}/sbin/{disklabel fdisk}/.
To avoid clashes with a build-host's header files, especially on
*BSD, the host-tools versions of fdisk and disklabel search for
#includes such as disklabel.h, disklabel_acorn.h, disklabel_gpt.h,
and bootinfo.h in a new #includes namespace, nbinclude/. That is,
they #include <nbinclude/sys/disklabel.h>, <nbinclude/machine/disklabel.h>,
<nbinclude/sparc64/disklabel.h>, instead of <sys/disklabel.h> and
such. I have also updated the system headers to #include from
nbinclude/-space when HAVE_NBTOOL_CONFIG_H is #defined.
1. Works if the last line does not end up in \n
2. Does not scan the string multiple times.
3. Does not copy the string, but writes it directly in the buffer.
4. Handles out of memory conditions gracefully.
the build step. Catches things like binutils which do a bunch of configures
on the build step and lose possibly. Fixes issues from PR#29197 for lex
not being picked up here.
so generated objects vs listed objects in make line up and dependcies happen
correctly. Found because libiberty (on this binutils import) was leaving
all objects as ./object.o and make wasn't picking up correct depends on
config.h as a result.
gets built and installed in a hp700 distribution.
TODO
- merge with hp300
- pick a preferred method for dealing with the elf headers.
hp700-mkboot and prep-mkbootimage (bintuils) vs mips-elf2ecoff and
tools/installboot
this is not currently being used and should be replaced with
HAVE_STRUCT_STATVFS_F_IOSIZE, but that will be done separately.
This commit should be able to be safely pulled up to
the netbsd-2-0 branch to address PR toolchain/26415
So, don't wrap definitions in it, and instead check for it and #error out
if it somehow leaks into scope.
Tested a complete build to sets on x86 from a clean source tree.
- Protect dirfd() macro so that we don't re-define it.
These changes make my build proceed further.
The problem is that automatically generated files, might include system
files before they include anything else (for example our yacc skeleton
includes <stdlib.h> before it does anything else). This foils the scheme
of defining _POSIX_SOURCE and friends so that _NETBSD_SOURCE does not
get defined; in fact, we include many files with _NETBSD_SOURCE defined,
enough to cause confusion in compat_defs.h which tries to re-define things.
exposed all the time, but routines which use it do not. Otherwise callers
of strtouq will lose.
XXX: Need to come back through here and clean up the configure tests better
for this
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
sure to use _POSIX_C_SOURCE and undef _NETBSD_SOURCE so the myriad of NetBSD
extentions don't get pulled into scope (and likely conflict at some point
with branched code trying to build on -current due to drift). Fixes PR#25533
XXX: The entire process here is just wacky and the entire cross tools process
needed to be reviewed to build clean w. just _POSIX_C_SOURCE or the equiv
set on NetBSD hosts or this will lose again somewhere..
no dependencies are known in advance. So a simple 'build.sh -r -u' will
often lose and end up with a TOOLDIR without a toolchain, groff, etc. Fix
by forcing .install_done to always run.
Instead of adding MAKE_BOOTSTRAP for hosted environments, i.e., when
you want things simple, instead add MAKE_NATIVE to get those hugely
important features like __RCSID().
Also, get rid of a now-unneeded -I.
This means that the tools now have correct dependencies (xxx.lo: ... instead
of xxx.o: ...) and in particular causes the pax to be built with consistent
headers.
There could also be other lossage on update builds of tools.
Fix the behaviour of native and tools gcc when MKPIC=no is specified for
platforms that mknative has determined support shared libraries.
XXX distrib/sets/sets.subr doesn't support MKPIC=no
and exception handling have a chance of working properly.
- creates libgcc, libgcc_eh and libgcc_s
- updates LIBGCC_SPEC to use them appropriately.
There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.
- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.
- updates the sets for the newly created libgcc* files.
- support for linking against the _pg version of libgcc has been removed.
- Disable symbol versioning (for now)
- Make sure that libiberty knows its being configured with a
cross compiler.
- The CXX_* variables are no longer needed/used.
- LIB2FUNCS_EXTRA gets pulled in via LIB2ADD
- Get LIB1ASMFUNCS and LIB2ASMSRC
- MAYBE_USE_COLLECT2 got renamed to USE_COLLECT2 (but might not
be used)
- Get EXTRA_HEADERS so that we get generate the right paths for
CPPFLAGS
- Get some variables related to shared libgcc
There are three levels of compliance w.r.t. HOSTEXEEXT. (1) built and
installed both wrong, (2) both right, and (3) one right, one wrong.
Most tool builds do (1), i.e., wrong, but not seriously so. This makefile
actually built them the "right" way, leading to error (3), which was fatal.