Commit graph

19 commits

Author SHA1 Message Date
Lionel Sambuc 4684ddb6aa LLVM Minix changes
- import libcxx
 - reduce targets to the one when compiled as a tools

Change-Id: Iabb8427f80ff8e89463559a28bcb8b4f2bdbc496
2014-07-28 17:05:59 +02:00
Ben Gras 0b79eac642 mmap: accept non-PROT_WRITE MAP_SHARED mappings
Currently we don't accept writable file mmap()s, as there is no
system in place to guarantee dirty buffers would make it back to
disk. But we can actually accept MAP_SHARED for PROT_READ mappings,
meaning the ranges aren't writable at all (and no private copy is
made as with MAP_PRIVATE), as it turns out a fairly large class of
usage.

	. fail writable MAP_SHARED mappings at runtime
	. reduces some minix-specific patches
	. lets binutils gold build on minix without further patching

Change-Id: If2896c0a555328ac5b324afa706063fc6d86519e
2014-07-28 17:05:20 +02:00
Lionel Sambuc 84d9c625bf Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
2014-07-28 17:05:06 +02:00
Ben Gras dda632a24f drop the minix_ prefixes for mmap and munmap
also cleanup of various minix-specific changes, cleanup of
mmap-related testing.

Change-Id: I289a4fc50cf8a13df4a6082038d860853a4bd024
2014-03-03 20:47:03 +01:00
Lionel Sambuc ff68abe6b3 Remove obsolete compatibility links
* /usr/bin/strip would be replaced by a link, even when compiling
    binutils.
 * Updated minix-spec.h to use the correct dynamic linker, and removed
    the previously used symlinks.
 * Removed the patch to the builtin PATH of ld.elf_so.

Change-Id: I4dc8a7fb77a11638f5105a4e15b6c9be5add750e
2014-03-01 09:04:56 +01:00
Anton Kuijsten 2e3046757a LLVM bitcode for almost the whole source tree
Change-Id: Ibc6f89de112e0649c3a3bfe49c2baa2ed0746212
2013-06-18 10:49:53 +02:00
Anton Kuijsten a74251eb16 allow ldd mmap fallback
Change-Id: Ia7b8aa88c3f063c804869065719ac0cbf049b7dd
2013-06-12 07:05:11 +00:00
Anton Kuijsten 1d71e39b73 Gold linker support for entire source tree 2013-06-11 22:51:02 +02:00
Ben Gras e92490cf47 ld.elf_so, grep, make: use mmap()
. let the dynamic linker use a real file mmap(), reverting
	  most of the minix-specific changes
	. except for a fallback mode for systems or filesystems that
	  do not support mmap() on files
	. make, grep: let them use mmap() too, with fallback

Change-Id: I11c0c9ad439d713917a6f5c2d196558f6c03eabd
2013-05-31 15:42:01 +00:00
Lionel Sambuc b1c4ba4ab6 ARM updates
Due to the ABI we are using we have to use the earm architecture
moniker for the build system to behave correctly. This involves
then some headers to move around.

There is also a few related Makefile updates as well as minor
source code corrections.
2013-01-17 10:03:58 +01:00
Lionel Sambuc f14fb60209 Libraries updates and cleanup
* Updating common/lib
 * Updating lib/csu
 * Updating lib/libc
 * Updating libexec/ld.elf_so
 * Corrected test on __minix in featuretest to actually follow the
   meaning of the comment.
 * Cleaned up _REENTRANT-related defintions.
 * Disabled -D_REENTRANT for libfetch
 * Removing some unneeded __NBSD_LIBC defines and tests

Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
2013-01-14 11:36:26 +01:00
Lionel Sambuc 9f7fb97000 Adding missing symlink to dynamic loader.
As the release script does not copy over files from the currently
running system anymore, it has appeared that some binaries are
looking for the dynamic loader in /lib instead of /usr/lib.

It has been replaced by a symlink to ensure compatibility with
binaries, until the path is updated in all the toolchains to be
the same.
2012-11-28 17:35:56 +01:00
Lionel Sambuc d19d7d58aa Toolchain upgrade and portability improvements.
upgrade to NetBSD CVS release from 2012/10/17 12:00:00 UTC

Makefiles updates to imporve portability

Made sure to be consistent in the usage of braces/parenthesis at
least on a per file basis. For variables, it is recommended to
continue to use braces.
2012-11-15 16:07:29 +01:00
Lionel Sambuc 9152e1c5a7 Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
 * tools
 * distribution
 * sets
 * release

The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.

For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.

Regarding new or modifications of Makefiles a few things:
 * Read share/mk/bsd.README
 * If you add a subdirectory, add a Makefile in it, and have it called
   by the parent through the SUBDIR variable.
 * Do not add arbitrary inclusion which crosses to another branch of
   the hierarchy; If you can't do without it, put a comment on why.
   If possible, do not use inclusion at all.
 * Use as much as possible the infrastructure, it is here to make
   life easier, do not fight it.

Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-11-15 16:07:29 +01:00
Ben Gras 6a6b7b5769 ld.so: be more mmap()-behaviour-independent
. if the layout of virtual address regions as returned
	  by mmap() without a location hint changes, ld.so could
	  trip itself up (under minix). this change allocates
	  the full size it needs for every object that's loaded
	  so that if that succeeds, it's sure there's virtual address
	  space for the whole thing no matter what other bits happen
	  to be there already.

	. this fix exposed a bug in the test; at atexit() execution
	  time the loaded object is unmapped, so that part of the
	  test is removed.
2012-06-25 14:13:07 +02:00
Ben Gras 755102d67f AT_SUN_EXECNAME support
. vfs: pass execname in aux vectors
	. ld.elf_so: use this to expand $ORIGIN
	. this requires the executable to reserve more
	  space at exec() calling time
2012-04-26 13:32:39 +02:00
Ben Gras 4b999f1962 build shared versions of libraries
building defaults to off until clang is updated.

current clang does not handle -shared, necessary to change the ld
invocation to build shared libraries properly. a new clang should be
installed and MKPIC defaults to no unless the newer clang is detected.

changes:

	. mainly small imports of a Makefile or two and small fixes
	  (turning things back on that were turned off in Makefiles)
	. e.g.: dynamic librefuse now depends on dynamic
	  libpuffs, so libpuffs has to be built dynamically too
	  and a make dependency barrier is needed in lib/Makefile
	. all library objects now have a PIC (for .so) and non-PIC
	  version, so everything is built twice.
	. generate PIC versions of the compat (un-RENAMEd) jump files,
	  include function type annotation in generated assembly
	. build progs with -static by default for now
	. also build ld.elf_so
	. also import NetBSD ldd
2012-04-16 05:21:20 +02:00
Ben Gras 53002f6f6c recognize and execute dynamically linked executables
. generalize libexec slightly to get some more necessary information
	  from ELF files, e.g. the interpreter
	. execute dynamically linked executables when exec()ed by VFS
	. switch to netbsd variant of elf32.h exclusively, solves some
	  conflicting headers
2012-04-16 00:41:42 +00:00
Ben Gras e83f7ba2c9 switch to netbsd csu
. file- and functionality-compatible with previous situation
          (FreeBSD csu) (with a crt1.o -> crt0.o symlink in /usr/lib)
        . harmonizes source with netbsd
        . harmonizes linker invocation (e.g. clang) with netbsd
        . helpful to get some arm code in there for the arm port project
2012-04-12 13:26:24 +02:00