Commit graph

353 commits

Author SHA1 Message Date
jperkin
3c2941b993 Since the MACHINE_ARCH cleanup, the bootstrap for i386-on-x86_64 Linux has
been broken due to NATIVE_MACHINE_ARCH no longer being set to x86_64.  Fix
this by introducing HOST_MACHINE_ARCH which refers to the underlying host
architecture rather than bmake's native architecture, thus differentiating
between cross-compiling and multilib.

This is currently only set on Linux as the only OPSYS which currently
requires such a test, but can be expanded to other OPSYS as necessary.
2016-03-17 16:02:23 +00:00
khorben
03a56367ef Re-arrange support for FORTIFY/MKPIE/RELRO/SSP
- No _GCC_* anything in mk/bsd.prefs.mk;
- No compiler flags in platform files.

Tested again on NetBSD/amd64, with and without cwrappers, with the same
outcome.

With feedback from jperkin@
2016-03-11 23:54:08 +00:00
khorben
dc4ad6b750 Add support for a number of security features
- Revisit (and rename) support for FORTIFY as PKGSRC_USE_FORTIFY (instead
  of PKGSRC_USE_FORT) for easier support outside NetBSD/gcc;
- PKGSRC_USE_SSP is no longer enabled by default when PKGSRC_USE_FORTIFY
  is enabled;
- PKGSRC_MKPIE builds executables as PIE (to leverage userland ASLR)
- PKGSRC_USE_RELRO builds with a read-only GOT to prevent some exploits
  from functioning.

Tested on NetBSD/amd64 by myself, in every combination, with and without
pkgtools/cwrappers. MKPIE is not supported at the moment with cwrappers.
Also, MKPIE is known to still break a number of packages when enabled (and
actually supported).

Tested on SunOS by jperkin@, thank you!

As discussed on tech-pkg@, the default behavior is not changed, except
where noted above.

ok bsiegert@
2016-03-11 23:03:31 +00:00
fhajny
124d88ee1d Strip --enable-new-dtags GNU ld arg on Darwin and SunOS. 2016-03-11 22:04:34 +00:00
jperkin
111893bb36 Remove _OPSYS_WHOLE_ARCHIVE_FLAG and _OPSYS_NO_WHOLE_ARCHIVE_FLAG, these
variables are unused and in at least one case were completely wrong anyway.
2016-03-10 16:58:19 +00:00
tnn
7f5db266bf pass correct ABI via OBJECT_MODE environment variable on AIX
It turns out a handful of AIX binutil-like utilities are particular
about type of object files they should examine.  Instead of piping
through flags for each utility everywhere, it is easier to just export
'OBJECT_MODE=[32|64]' instead.

From Eric N. Vander Weele.
2016-03-04 21:25:47 +00:00
jperkin
b4e6a0bbf3 Remove a commonly used set of GNU ld arguments which are incompatible
with the Darwin linker.  Fixes various packages.
2016-02-29 10:05:47 +00:00
jperkin
43cbbd8b78 Default to the system libuuid. The system headers assume that the libuuid
header provides the uuid_string_t typedef, which is not the case with the
version coming from pkgsrc.
2016-02-24 14:59:56 +00:00
jperkin
22af365a50 Export OSX_VERSION (renamed from OSX_VERS) to the environment regardless of
whether we're using the SDK path or /usr/include, as it is useful for other
contexts than simply determining the SDK directory.
2016-02-22 19:57:41 +00:00
jperkin
698717d710 Extend the El Capitan HFS+ bug workaround to 15.1.0 but no further, I can
confirm that Apple fixed the bug in the recent 15.2.0 (10.11.2) update.
2015-12-14 14:14:33 +00:00
sevan
168d1b7354 Define MACOSX_DEPLOYMENT_TARGET for Tiger to allow current releases
of software such as Ruby to build on Tiger/PowerPC.
Tested with & without on a G4 with Tiger & Leopard.
It was not needed on Leopard as the linker defaults to a target of 10.5 &
setting it back broke the bootstrap process.

Reviewed by wiz@ long ago.
2015-12-13 22:38:00 +00:00
jperkin
42f3575ed2 Ensure building 32-bit on 64-bit is supported when using cwrappers too. 2015-11-18 22:30:12 +00:00
jperkin
6e420f7378 Always set _OPSYS_CAN_CHECK_SHLIBS to "yes" regardless of whether
TOOLS_PATH.readelf is set.  This is a PKG_DEVELOPER feature and it's
likely the developer is smart enough to either have it already available
in $PATH or be able to install it (e.g. via devel/binutils) if required.
2015-11-16 15:59:59 +00:00
sevan
a34c13abf3 MACHINE_ARCH for Bitrig/amd64 is now set to x86_64
Ammend if statement
2015-11-07 23:46:28 +00:00
jperkin
f0a45a9e36 GCC on SunOS supports a non-standard -mimpure-text argument which clang
does not have, so remove it unconditionally in the latter case.  Fixes
various packages.
2015-10-26 09:33:16 +00:00
jperkin
2385012594 Set PKG_FAIL_REASON with a useful failure message if we cannot find an SDK. 2015-10-10 13:12:50 +00:00
jperkin
8c5fa136b6 OSX El Capitan has an interesting file system bug which allows a deep
directory hierarchy to be created but not removed.  This is triggered by
the GNU getcwd-path-max.m4 configure test used in lots of GNU software,
and causes the builds to fail in pbulk as 'make clean' cannot complete.

For now we provide a cached result for the test to avoid running it,
using a 'no' value as the test is for a specific glibc bug.

This bug has been brought to Apple's attention by the NixOS developers,
raised as https://openradar.appspot.com/radar?id=6160634819379200.  For
now we mark only 10.11.0 (15.0.0) as having the bug - it remains to be
seen whether Apple will fix it in the upcoming .1 release.
2015-10-08 11:36:00 +00:00
jperkin
348b937c46 Re-order the way _OPSYS_INCLUDE_DIRS is calculated, and only perform checks for
the SDK path if we need to.

This avoids issues on Yosemite and Xcode 7, which drops support for the 10.10
SDK.  Trying to determine the SDK path fails, but the failure is not cached in
the xcrun database, so each call to a compiler tool is unecessarily delayed (by
around 3 seconds on my build hosts).

For users still on Yosemite who have upgraded to Xcode 7, the solution is to
install the Command Line Tools so that /usr/include is populated and used.
2015-10-05 17:06:22 +00:00
jperkin
d81e076eb6 _OPSYS_LIB_DIRS entries must be space-separated, not colon. 2015-09-10 19:49:58 +00:00
jperkin
7af5418044 Disable the strip flag for install(1) by default on Darwin. When called
without arguments, strip(1) will attempt to strip all symbols by default,
and when it is unable to do this will fail with a non-zero exit status.

Passing '-u -r' to strip(1) would in theory resolve the issue, but there
is no simple of way of doing this due to the way strip is called by the
native install program through XCode.  We would need to build a patched
bsdinstall for Darwin, so for now we just disable stripping on install,
as many packages have had to do individually up until now.
2015-09-07 11:48:35 +00:00
jperkin
e278916c18 Default to pkgsrc openssl from OSX Lion / 10.7 onwards, where the native
openssl is marked as deprecated.  This causes failures in pkg_install now
that WARNS works correctly (-Werror,-Wdeprecated-declarations).
2015-09-01 11:12:30 +00:00
jperkin
f648dfa7c3 Introduce support for checking Mach-O dynamic libraries.
This works in a similar way to the ELF checks, but uses otool(1) to list the
library name and its dependencies, and the checks fail if there are WRKDIR
references or if the -install_name of the library does not match $PREFIX, as
well as ensuring that any libraries from pkgsrc are correctly registered as
full dependencies.

Removes support for the user to set USE_CHECK_SHLIBS_ELF, but there were no
reasonable reasons for doing so in the past anyway, and it may be masking
issues in platform files we should fix.
2015-08-17 17:35:23 +00:00
khorben
8ce191e1e1 Add support for building with fortify
This is pretty much the same change as with SSP, and completes it with
support for fortify (like USE_FORT in NetBSD's base system). Like SSP, this
is disabled by default for the moment. Like in NetBSD's base system,
enabling fortify explicitly also enables SSP by default - but SSP can still
be disabled explicitly in this situation.

All four combinations tested on NetBSD/amd64.
2015-08-10 21:44:34 +00:00
khorben
f8c9df2a2f More efficient check if SSP is enabled
With this change, the check if the current architecture is supported is
only performed if SSP is enabled in the first place. This should not
change the current behavior; tested on NetBSD/amd64.

Suggested by wiz@
2015-07-27 23:37:38 +00:00
khorben
ae79ea7d78 Add support for compiling with stack-smashing protection
This is enabled with PKGSRC_USE_SSP in mk.conf(5), as documented there.
Most NetBSD platforms are supported (when compiling with gcc).

After consensus on tech-pkg@.
2015-07-26 22:13:17 +00:00
wiedi
6bd4b3b644 Detect arm-linux-gnueabihf correctly 2015-07-18 15:08:43 +00:00
ryoon
eef963f5da Fix QNX bootstrap.
From Jan Danielsson.
2015-07-04 07:15:22 +00:00
tron
fc671b3ed5 Don't use "/bin/ksh" as wrapper shell under Mac OS X Mavericks. It was
previously excluded for a good reason.
2015-07-01 17:47:14 +00:00
adam
d223dd19c2 Always use current system version SDK avoiding future SDKs, because this makes unuable binaries; use ksh as wrapper script on newer systems as well 2015-06-26 13:51:57 +00:00
sevan
8514571a7a Introduce preliminary support for Bitrig to pkgsrc
Initial patchset to add support by rodent@
Further adjustments made based on feedback by joerg@
Tested by myself with numerous bulkbuilds thanks to Patrick Wildt @ Bitrig

Reviewed by bsiegert@ joerg@ wiz@
2015-06-04 15:48:45 +00:00
joerg
9ac8fcc75b Let's unconditionally depend on useradd on NetBSD. It has been in base
since 1.4 at least.
2015-05-26 10:08:37 +00:00
sevan
392fe1c36f The path to SU is correct
type is a shell builtin on the bundled OpenBSD pdksh
Remove comment as instructed by comment.
Checks performed on OpenBSD 5.7-current
2015-05-21 17:15:48 +00:00
sevan
98f4407ec4 For 64bit little endian PowerPC hosts running Linux
Set the ABI to 64 bit
Define the suffix appended to the locations in the library search path

Reviewed by bsiegert@
2015-05-08 20:28:30 +00:00
joerg
cd74494def Add a new ulimit modifier for cputime. Support raising limits for
package creation.

There are very few things in pkgsrc that needs more than one hour per
process on decently fast hardware, so setting that as (soft) limit for
bulk builds avoids the infinite loops seen in some other packages. There
are a few select exceptions, i.e. flightgear-data needs more than one
hour for pkg_create when using xz. This flag allows selectively giving
those places more time without wasting resources in the broken cases.
2015-04-21 17:01:55 +00:00
tnn
1706e60098 NOLOGIN needs to be /usr/bin/false here. Probably copy-pasto from OSF1.mk. 2015-04-19 12:02:15 +00:00
tnn
e9d8d4a3f7 fix comment about pkgtools/compat_headers 2015-04-18 22:56:19 +00:00
jperkin
47daaded56 Default to the native getopt when available. 2015-04-17 08:22:30 +00:00
jperkin
19d9cf3aa3 Stop defaulting to the builtin mit-krb5, it's an old copy which is
unlikely to be updated any time soon, and is preventing some Samba
Kerberos features from working correctly.
2015-04-17 08:21:01 +00:00
tron
30e45f837e Report that SunOS 5.10 and older don't have "err.h".
Change during freeze approved by Jonathan Perkin.
2015-03-19 19:15:23 +00:00
jperkin
d460a8ce9f Remove obsolete bulk build variables. 2015-02-16 10:42:00 +00:00
obache
d1dc7d256d Revert "Drop obsolated old bulk build related variable settings."
proposed/discussed is required for such changes.
2015-02-01 11:42:59 +00:00
gdt
45d83d6697 10.9 also has Xcode 6.
Note that older os versions sometimes get xcode updates and that
pkgsrc generally expects xcode that is up-to-date relative to the base
os.
2015-01-03 21:30:52 +00:00
ryoon
d011bd8c78 My OS X Yosemite machine says Xcode is version 6.1.1. 2015-01-03 18:27:15 +00:00
bsiegert
af85f266f9 Do not use gcc-specific compiler flags on Mac OS versions that come with
clang. Update version for bootstrap-mk-files.

Patch provided by Todd Kover in PR pkg/48966.
2014-11-22 16:32:13 +00:00
obache
da209eba3e Drop obsolated old bulk build related variable settings. 2014-11-21 10:46:36 +00:00
jperkin
7df37958c1 Expand --version-script removals for SunOS back out into package Makefiles
rather than trying to consolidate into a single fnmatch.  There aren't that
many of them, and it will aid the integration of cwrappers which doesn't
support globs.
2014-09-10 15:59:33 +00:00
gdt
c127d72893 Default to X11_TYPE=modular on netbsd-5.
Base xsrc on netbsd-5 has not really worked with pkgsrc for a while,
because various programs need newer versions of various X pieces.  The
2014Q2 official bulk builds are missing about 1500 packages as a
result of this.  Therefore, switch to modular on netbsd-5 (as netbsd-4
has been for a very long time), which should result in more useful
binary packages for netbsd-5 for 2014Q3.

(There is a notion of updating netbsd-5 base xsrc to more modern xorg.
If that happens, and there's a 5.x formal release, and builds show
that pkgsrc with native succeeds on it, this can perhaps be flipped
back.  Odds are that's not going to happen, and it's overwhelmingly
unlikely to happen soon.)

Anyone who prefers to stay with native can set X11_TYPE=native in
mk.conf.

Note that this is about pkgsrc and specifically the default
dependencies for pkgsrc programs that use X11, so the native servers
are unaffected and can be run from /usr/X11R7, the same as they are
now, without any changes being necessary.  (This message is in fact
being typed on a system with a native server, native xterm and modular
libs for pkgsrc.)

Discussed on tech-pkg, tech-x11 multiple times over the last 6 months
or so, and specifically encouraged by wiz@.
2014-09-02 16:13:27 +00:00
jperkin
209b757821 Expand out the list of GNU ld flags we want to remove, rather than applying
a blanket removal of any long options, richard@ is concerned this may affect
packages which use the long options now available in newer SunOS ld.

Whilst here, transform --rpath to -R, used by a few packages.
2014-08-28 15:46:35 +00:00
jperkin
2c9fb0222c Remove any -Wl,--* arguments, they are guaranteed to be GNU ld specific
and unsupported by the SunOS linker.  Tested to only have positive results
in a bulk build.
2014-08-28 10:54:07 +00:00
jperkin
bcc20d049d Add -Wl,-export-dynamic to the list of GNU ld patterns to remove. 2014-08-21 15:31:24 +00:00