Commit graph

34 commits

Author SHA1 Message Date
Thomas Veerman
e1c7263ee4 Fix build error on OSX
When building Gold on OSX 10.9 and Clang 6.0, the build process fails
with the error:

In file included from /Users/thomas/minix/tools/binutils/../../external/gpl3/binutils/dist/gold/binary.cc:31:
In file included from /Users/thomas/minix/tools/binutils/../../external/gpl3/binutils/dist/gold/stringpool.h:23:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:438:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar:107:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype:54:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype:51:72: error: use of undeclared identifier 'do_not_use_isalnum_with_safe_ctype'
inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);}

Signed-off-by: Thomas Veerman <tveerman@gmail.com>
Change-Id: Ib7ca13a51e83c31bb3020d755e04b308aeacde5d
2014-10-10 12:56:50 +02:00
Lionel Sambuc
025179a2b7 Update download urls in fetch.sh
Change-Id: Ib3d6c2771e8bc6d03efa85af52f2ed6288ebc7dd
2014-08-07 14:27:32 +02:00
Lionel Sambuc
341705a4ad fix for crosscompile with llvm and build libstdc++
Change-Id: I1da0b77214a2e128a2649d518e4cf8d23cf13bc0
2014-07-28 17:06:27 +02:00
Lionel Sambuc
4359ff87e0 Replace cc, c++ & cpp with symlinks
In case of installation of both clang and GCC, we want to be able to
switch which one is the default by adapting the cc, c++ & cpp symlinks.

The default behaviour implemented here is to prefer clang over gcc if
they are both installed.

Change-Id: Ic14720cd876d2bf934d345a955cb5789378209e6
2014-07-28 17:06:02 +02:00
Lionel Sambuc
fed2e50bd7 Compile gold as a tool on MINIX/llvm-only system
This patch is mostly copy-past from answers found in:
  http://www.marshut.com/ikhnkn/compiling-gold-with-libc-and-stl-hash-string.html

This combines the first submitted patch, but applied on gold/gold.h
instead of gold/system.h, as well as the freebsd changes.
2014-07-28 17:06:00 +02:00
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
5b851f3a9c patch(1) problems workaround
. NUL input in 2 source files cause patch(1)
	  to truncate the input (and fail the patches); a sed
	  command removes the NULs
	. in binutils/ld, configdoc.texi is patched to be removed
	  but some patch(1)es leave an empty file, causing build problems;
	  this file is explicitly removed.

Change-Id: Iec38d3992b0df4f7bbb9a87b1320005ab3272ff1
2014-07-28 17:05:20 +02:00
Ben Gras
4193f2292e fix for ld.so @ bitcode build
ld.so linked with gold didn't work - gold was not generating
the _DYNAMIC ptr in the first GOT entry, leaving it zero, causing
mayhem for ld.so.

  . patch for gold: always generate _DYNAMIC ptr. submitted upstream,
    more info here: https://sourceware.org/bugzilla/show_bug.cgi?id=16900
  . revert "REMOVE ME: Static tests for now" - we can link tests dynamically
    This reverts commit 3e0a3993deb831eb5abcd1c1a2cb1246b43f8d1d.

Change-Id: I4f2910ec2592c31bbd14a85d8a6045497fcaf4e3
2014-07-28 17:05:12 +02:00
Ben Gras
c81f587520 backport 2 binutils patches
These 2 patches are from upstream binutils and together properly
detect whether -ldl is necessary and available to build ld and gold
in plugins mode, instead of hard-coding its usage always. This lets
us build ld and gold on *bsd and minix systems, which do not have
or need -ldl for dl*() functions.

Change-Id: Ie21d027f5d7c225edc9e6e0c6fa2e4b34f421415
2014-07-28 17:05:12 +02:00
Lionel Sambuc
c9ea9e7af8 Binutils: Synchronization & Gold activation
Change-Id: I5235984746178ee30b5db18e7def0016d9a0e36f
2014-07-28 17:05:11 +02:00
Lionel Sambuc
29b8e5ff06 Replace wget with ftp as default in fetch scripts
This default is overriden by curl when it is available on the system.

This allows for the fetch script to work on MINIX systems without any
additions from PKGSRC, while requiring either a netbsd compatible ftp or
curl to be installed on other systems.

Change-Id: Id79f799e1ef0f5fde6bb1c0e570984b7579519fb
2014-07-28 17:05:08 +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
Lionel Sambuc
acc46143ab Updating saved configure line in gcc
GCC embeddeds in a string the configuration used when building itself,
this patches just updates that string to match the configuration
actually used.

Change-Id: Ife8f61570b94eb17ce5808b5b58cc5e75e9dc64f
2014-03-01 09:04:57 +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
Lionel Sambuc
913340b559 Enable sys-root support in the native binutils
sysroot support was enabled only for cross versions of the binutils
tools.

This patch also activate it for the native tools which are installed
on the target system.

Change-Id: Ica5de7e20719a63f3b695477b767c30d0a93490c
2014-03-01 09:04:55 +01:00
Ben Gras
c8f3b10909 fix a few more minix specific warnings
. also disable stack protection feature for gcc,
	  causes build errors for pkgsrc gcc on minix

Change-Id: I1c6e2bcb4d948098d642543d7b2711284ee55c72
2013-08-27 16:16:03 +00:00
Ben Gras
1fbbfa06c2 gcc: realize gas supports visibility
. solution for "warning: visibility attribute not supported in
	  this configuration"
	. needed to make warnings fatal, -Werror

Change-Id: If972300a82df570093f2d89825935483ff69fb18
2013-08-26 18:02:43 +00:00
Lionel Sambuc
0cdf705cc6 Enable optional GCC install and GCC improvements
-By adding MKGCC=yes and MKGCCCMDS=yes on the make commandline
   it is now possible to compile and install GCC on the system.

   Before doing this, if you are not using the build.sh script,
   you will need to call the fetch scripts in order to retrieve
   the sources of GCC and its dependencies.

 -Reduce difference with NetBSD share/mk

   Move Minix-specific parameters from bsd.gcc.mk to bsd.own.mk,
   which is anyway patched, so that bsd.gcc.mk is now aligned
   on the NetBSD version.

 -Clean libraries dependencies, compiles stdc++ only if gcc is
   also compiled (it is part of the gcc sources)

 -Correct minix.h header sequence, cleanup spec headers.

 -Fix cross-compilation from a 32bit host targeting MINIX/arm

Change-Id: I1b234af18eed4ab5675188244e931b2a2b7bd943
2013-07-12 14:22:03 +02:00
Lionel Sambuc
c566d4623b Allow install of binutils and import texinfo
- Enable installing binutils from the base system.

 - Import texinfo which is required for the binutils tools
   to be compiled.

 - Also adapted the fetch rules to correctly generate the
   gitignore files for gcc, and allow the case of multiple
   modules in the same directory, as found in gnu/dist.

Warning: This patch has an entry in docs/UPDATING

Change-Id: Ib781734e8fd7f9c6265fa65d62ba2cf3fccbc5ba
2013-07-12 14:18:08 +02:00
Lionel Sambuc
4af66e563d Upgrading to binutils-2.22
* Added --with-ld=default
 * Added --with-lto
 * Fixed ld script for ARM
 * Options are prepared for future activation of gold.

Change-Id: Id9618904055e18d1b37f5e9585f775c367ff356e
2013-07-08 18:53:55 +02:00
Anton Kuijsten
1d71e39b73 Gold linker support for entire source tree 2013-06-11 22:51:02 +02:00
Lionel Sambuc
10f4c3fbb1 Reduce differences in libgcc Makefiles for ARM
Change-Id: I1b6b18bce063550907aa6e9ea2061e12b0855de4
2013-03-08 09:41:49 +01:00
Lionel Sambuc
8e4736f2df Removing obsolete _MINIX define
Change-Id: Id33ac7e973d1c0e249b690fe44a597474fac6076
2013-02-26 09:44:20 +00:00
Ben Gras
5a0585359d ARM divsi3.S: raise(SIGFPE) when called for
. raise(SIGFPE) for modulo-0/divide-0 operations in
	  internal int division functions
	. gcc: do not link with -lgcc anywhere so these internal
	  functions are always used from libc instead of (sometimes)
	  masked by -lgcc
	. together fixes test53 on ARM

Change-Id: I31ec19dfdd68b8a92695595da901874e63106f9d
2013-02-09 22:24:59 +01: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
b86af8be0b Toolchain adaptation for ARM MINIX support 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
456a46e6bf Removing useless minix/types.h header
Change-Id: If5f922279b87f075f301b64c7786caa18b434c2a
2012-12-07 13:58:06 +01:00
Lionel Sambuc
b8a678ef1d Cross compile on minix support
* Remade patch so it works with minix patch tool.

 * New MINIX tar support -ox, so revert back to it

   In fetch scripts, tar had been replaced by bsdtar as the prebvious
   tar did not support the -o flag under minix, which is required to
   prevent usage of tar file stored user and group information.

   This introduces portability problems. As our new tar tool now
   support that flag revert back to improve portability.
2012-11-15 16:07:30 +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
Lionel Sambuc
e1c1f5bfd9 Replaced tar with bsdtar to ensure disponibility of -o, which is
needed during builds as root
2012-11-15 16:07:29 +01:00
Thomas Veerman
3f40eb3511 fetch.sh: serve tarballs ourselves
And use the original sources as backup.
2012-06-25 10:46:31 +00:00
Thomas Veerman
18a5822eff Partially import gcc and binutils
They are used as build tools for cross compilation. This import does
not include the full distribution. Rather, it sports a shell script
that will download and patch the distribution when compiled from
/usr/src/tools (yet to be committed). This part of the source tree is
only necessary for cross compilation. It's not used or compiled for
native builds.
2012-06-18 10:54:16 +00:00