Commit graph

390 commits

Author SHA1 Message Date
khorben
4211ac7e85 Add granularity to PKGSRC_USE_FORTIFY and PKGSRC_USE_RELRO
The new options are, for FORTIFY:
  "no"     Do not pass any flags for FORTIFY
  "weak"   Pass -D_FORTIFY_SOURCE=1
  "strong" Pass -D_FORTIFY_SOURCE=2

This allows users to reduce the level of FORTIFY specified if necessary
or desired. The previous setting as "yes" is now equivalent to "strong"
(the default when enabling).

The new options are, for RELRO:
  "no"      Do not pass any flags for RELRO
  "partial" Pass -Wl,-z,relro
  "full"    Pass -Wl,-z,relro -Wl,-z,now

This allows users to reduce the level of RELRO specified if necessary or
desired. The previous setting as "yes" is now equivalent to "full" (the
default when enabling).

This is intended to match the changes committed by jperkin@ (for SSP)
after our discussion a (long) while back.

No functional change intended (with the settings supported so far).
2017-04-16 23:12:37 +00:00
sevan
3425d1a52b powerpc64le is little endian. 2017-02-01 09:55:07 +00:00
jperkin
b673fabd21 Add support for enabling cwrappers automatically. USE_CWRAPPERS now defaults
to "auto", which will enable cwrappers if the _OPSYS_SUPPORTS_CWRAPPERS
platform variable is set to "yes".

Switch over to cwrappers by default for Darwin, Linux, and SunOS (except when
using the sunpro compiler).
2016-10-27 10:31:05 +00:00
jperkin
c02e752f64 Change PKGSRC_USE_SSP to a quad option. The options are now:
"no"     Do not pass any stack protection flags (the default)
   "yes"    Pass -fstack-protector
   "strong" Pass -fstack-protector-strong
   "all"    Pass -fstack-protector-all

This allows users to configure the level of stack smashing protection they
require, and ensures consistent behaviour across platforms.  Users running
on NetBSD who previously used the option will need to change "yes" to "all"
to match the previous default configuration for that platform.

While here use _WRAP_EXTRA_ARGS to ensure the flag gets passed regardless
of whether the package honours CFLAGS, and support additional wrappers.

Discussed a while back with khorben, and used in production for the SmartOS
2016Q1 package sets with the "strong" option.
2016-06-13 13:26:42 +00:00
jperkin
901f82f6b8 Revert part of the MACHINE_ARCH cleanup that resulted in the Linux/x86_64
triplet reporting as x86_64-pc-linux.  Go back to the previous triplet of
x86_64-unknown-linux which matches what config.guess outputs.
2016-04-17 08:13:09 +00:00
joerg
639d5b402f Remove support for USE_DESTDIR=no. 2016-04-10 15:58:02 +00:00
joerg
54362eeca1 Remove last glue for PKG_DESTDIR_SUPPORT=none. 2016-04-10 15:10:12 +00:00
joerg
bfef30f0c8 Drop support for PKG_DESTDIR_SUPPORT=none. 2016-04-10 15:08:39 +00:00
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
tnn
7ca6d09a6a let's do just "Solaris" instead of "Oracle"
The only current use of this is pbulk's subject line, and Solaris 11.3
makes more sense than Oracle 11.3.
2016-03-11 05:42:35 +00:00
tnn
52872bb412 for SunOS, assume that OS_VARIANT is Oracle if no match on other variants
for OmniOS, stop processing /etc/release after the first line
2016-03-11 04:58:51 +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
jperkin
ac56158090 Attempt to bring sanity to how ABI and MACHINE_ARCH are set.
Previously there were at least 5 different ways MACHINE_ARCH could be set,
some statically and some at run time, and in many cases these settings
differed, leading to issues at pkg_add time where there was conflict
between the setting encoded into the package and that used by pkg_install.

Instead, move to a single source of truth where the correct value based on
the host and the chosen (or default) ABI is determined in the bootstrap
script.  The value can still be overridden in mk.conf if necessary, e.g.
for cross-compiling.

ABI is now set by default and if unset a default is calculated based on
MACHINE_ARCH.  This fixes some OS, e.g. Linux, where the wrong default was
previously chosen.

As a result of the refactoring there is no need for LOWER_ARCH, with
references to it replaced by MACHINE_ARCH.  SPARC_TARGET_ARCH is also
removed.
2016-01-24 16:14:44 +00:00
rillig
d904a0c3e5 Added keyword "platform" for "bmake help" 2016-01-12 19:55:41 +00:00
joerg
d0abbc4cdc Make USE_DESTDIR != yes an error. 2015-12-27 12:37:29 +00:00
sevan
93d320158c With OpenBSD/amd64 & Bitrig/amd64 switched to using MACHINE_ARCH=x86_64,
amd64 no longer needs to be accounted for specifically.
Remove redundant references.


Reviewed by wiz@
2015-11-07 20:00:19 +00:00
sevan
4de02a05c5 Add the necessary logic for setting Bitrig/amd64 to Bitrig/x86_64.
Switch to using arch(1) to populate $LOWER_ARCH on Bitrig

Reviewed by wiz@
2015-11-07 19:53:49 +00:00
sevan
266cff67cd Add the necessary logic for setting OpenBSD/amd64 to OpenBSD/x86_64.
Reviewed by wiz@
2015-11-07 13:35:44 +00:00
sevan
5481fd2fed Add the mapping for amd64 to its GNU architecture name x86_64.
Needed for switching OpenBSD/amd64 & Bitrig/amd64 to x86_64.

Reviewed by wiz@
2015-10-17 01:50:46 +00:00
jperkin
8a8b2cd412 Ensure OBJECT_FMT is set to ELF on Linux rather than relying on the NetBSD
MAHCINE_ARCH settings in bsd.own.mk.  Fixes at least Sevan's arm64 host.
2015-09-08 12:07:55 +00:00
jperkin
e5e50a0024 Remove NetBSD 0.x and 1.x settings, these have long since been unsupported. 2015-09-08 11:36:34 +00:00
sevan
2e45b2e256 Introduce $LOWER_VARIANT_VERSION, this is used to store version info for variant
Operating Systems.
For SmartOS, store the result from running uname -v & trimming the joyent_
prefix.
For OmniOS, store the result from processing /etc/release with awk(1)


Reviewed by joerg@ bsiegert@
2015-07-25 15:11:09 +00:00
joerg
11d2712a27 Remove USE_X11BASE and X11PREFIX. 2015-07-04 16:18:28 +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
jperkin
1a2757e82f Introduce _USE_CWRAPPERS logic to ensure consistency, USE_CWRAPPERS could
differ between a package and user setting, resulting in incorrect WRAPPER_*
values being set from wrapper-defs.mk.
2015-04-29 14:23:23 +00:00
tnn
a0c69e7229 correct MACHINE_ARCH and compiler flags for HP-UX 64-bit ABI 2015-04-27 10:33:49 +00:00
joerg
7049152f2f Specify safer WRKSRC for meta packages. As they don't extract files,
they won't create the subdirectory either. Since the SUBST targets try
to change to WRKSRC first, they fail. This is seen with meta packages
depending on Freetype2 when using X11_TYPE=native.
2015-04-19 01:37:55 +00:00
sevan
5e14f67fd5 OS X Tiger & prior used X11 from XFree86 project which is installed in
/usr/X11R6, set X11BASE to this location on those versions.

Reviewed by wiz@
2015-03-14 17:37:19 +00:00
riastradh
d50065e40e Fix typo: NATIVE_MACHINE_ARCH, not NATIVE-MACHINE_ARCH. Thanks, prlw1! 2015-02-24 13:26:34 +00:00
jperkin
9bd9dd1345 Put back SCO LOWER_OPSYS changes. 2015-02-16 10:43:36 +00:00
riastradh
82fa031ffe Accommodate an -eabi{,hf} suffix in MACHINE_GNU_PLATFORM.
This is necessary to match what NetBSD `build.sh tools' generates for
cross-compiler toolchains on earm.

Also, split APPEND_ELF into APPEND_ELF and NATIVE_APPEND_ELF, so we
don't get a spurious netbsdelf in NATIVE_MACHINE_GNU_PLATFORM when
cross-compiling on amd64 for earm.
2015-02-14 05:01:32 +00:00
obache
5626a25ce6 Revert "Move version part from LOWWER_OPSYS to LOWER_OPSYS_VERSUFFIX for sco.",
proposed/discussed is required for such changes.
2015-02-01 11:33:08 +00:00
dholland
3574122bf5 Add a bunch of missing LP64PLATFORMS after reviewing the list in NetBSD's
build.sh:
	*-*-aarch64{,eb}
	*-*-ia64
	*-*-mips64{eb,el}
	*-*-powerpc64
	*-*-riscv64
2015-01-01 09:00:28 +00:00
dholland
9ccf5c3c80 Add BIGENDIANPLATFORMS and LITTLEENDIANPLATFORMS, like LP64PLATFORMS, for
restricting broken packages.
2015-01-01 08:57:23 +00:00
dholland
de73f20ecb Add support for BROKEN_ON_PLATFORM and BROKEN_EXCEPT_ON_PLATFORM, as per
discussion on tech-pkg.

BROKEN_ON_PLATFORM and NOT_FOR_PLATFORM are the same, except that
(now) BROKEN_ON_PLATFORM sets PKG_FAIL_REASON and NOT_FOR_PLATFORM
sets PKG_SKIP_REASON. BROKEN_EXCEPT_FOR_PLATFORM and ONLY_FOR_PLATFORM
correspond in the same way.

The idea is that going forward we will distinguish unbuildable
packages that theoretically ought to be fixed (these are BROKEN) from
packages where it doesn't make sense to build (these are NOT_FOR)...
examples of the former include most non-64-bit-clean packges; examples
of the latter include OS-specific language bindings.

A general review of the uses of NOT_FOR_PLATFORM and ONLY_FOR_PLATFORM
(converting many of them to BROKEN...) is coming up.

Similarly, a general review of the uses of PKG_FAIL_REASON and
PKG_SKIP_REASON is coming up.

For this to become useful, pbulk needs to be taught to report failing
and skipped packages differently - the idea is that failing packages
should be reported up front and skipped packages don't need to be. This
has not been done yet, but one set of things at a time...
2015-01-01 06:06:06 +00:00
wiz
627d407a75 Remove pkg_views support, second part: infrastructure. 2014-12-30 15:13:19 +00:00
obache
8dfc2c3814 undefined PKGSRC_KEEP_BIN_PKGS must not be evaluated unconditionally. 2014-12-07 06:22:52 +00:00
agc
4b9f0a9c84 Add a new definition, PKGSRC_KEEP_BIN_PKGS, which defaults to "no".
This definition controls whether the binary package which is built
during package installation will be copied to pkgsrc/packages/All.

To retain binary packages in pkgsrc/packages/All, set

	PKGSRC_KEEP_BIN_PKGS=yes

in environment or MAKECONF. If this is not set, binary packages
will not be preserved after their WRKDIR is removed. This may not
be what you want.

To preserve the status quo since 2013/05/22, and just delete the
binary package after it's built, the default for PKGSRC_KEEP_BIN_PKGS
is "no", or it can be explicitly set.

As reviewed on tech-pkg.
2014-12-06 23:28:18 +00:00
obache
52d94a7407 Move version part from LOWWER_OPSYS to LOWER_OPSYS_VERSUFFIX for sco. 2014-11-29 06:03:02 +00:00
joerg
3dd0b5fcf6 Sync MACHINE_ARCH -> GNU_ARCH mapping table with NetBSD. Most noticable
change outside ARM is going to i486 as platform name for x86.
2014-11-18 23:36:07 +00:00
jperkin
aec701da4b Split SMF handling across bsd.pkg.mk and bsd.prefs.mk. Should fix issues
with packages which include bsd.prefs.mk before setting SMF variables.
2014-08-14 11:08:37 +00:00
jperkin
5329420146 Move INIT_SYSTEM to bsd.prefs.mk, allowing it to be tested in
package Makefiles when packages perform custom rc.d handling.
2014-05-06 14:48:06 +00:00
ryoon
2c73f854ac Add amd64 to LP64PLATFORMS, OpenBSD returns amd64 instead of x86_64
No objection on public mailinglist.
2014-05-05 21:26:31 +00:00
asau
e372c26ad4 Define OBJECT_FMT for FreeBSD.
Ignore long time obsolete FreeBSD 1-3 and consider FreeBSD ELF-only.
2014-04-07 17:25:16 +00:00
ryoon
d2e4b66d48 Add SCO OpenServer 5 and 6 support, 6 support is not tested yet. 2014-03-14 22:05:18 +00:00
jperkin
a54399a1b3 Detect newer RedHat distributions. 2014-03-07 14:52:12 +00:00
ryoon
379e58401a Use .elif, not .else if 2014-02-22 09:40:52 +00:00
jperkin
96fa724baf Support X11BASE?=/usr for native X11 on RedHat and derivatives. 2014-02-20 21:27:43 +00:00