Commit graph

195 commits

Author SHA1 Message Date
rillig
e5b3aa104f mk/check: remove documentation for obsolete SKIP_PORTABILITY_CHECK 2019-10-06 13:38:22 +00:00
rillig
1a49091403 mk/check/check-perms.mk: complete the _VARGROUPS section 2019-10-01 21:56:11 +00:00
rillig
3e43360828 mk/check/check-perms.mk: fix typo in _VARGROUPS section 2019-10-01 21:48:30 +00:00
maya
e34ba8f311 Don't complain if binaries without an interpreter or .dynamic section don't
have a GNU_RELRO flag. (they won't because it doesn't do anything to them).

Should eliminate some of the need for CHECK_RELRO_SKIP, especially for some
Go binaries.
2019-04-24 22:56:47 +00:00
rillig
2b74bc126e mk/check: document how check-portability.sh is typically invoked 2019-01-17 00:11:44 +00:00
triaxx
1866d140cc check-shlibs.mk: avoid l10n of awk-parsed messages.
Fix PR 53119
2018-10-01 14:59:49 +00:00
dbj
ad7e5443a5 check-shlibs-macho.awk: revert previous
Revert this fix until we can determine a possibly better fix.
2018-06-07 07:00:10 +00:00
dbj
0af4e4a4a0 check-shlibs-macho.awk: fix support for checking modules
Allow the dylib install_name to be just the library basename
2018-06-07 04:58:46 +00:00
jperkin
47e24bbfb7 check-shlibs-macho.awk: Implement revision 1.3 correctly.
Skip any lines of otool output that do not start with a tab, ensuring we
only check valid files and ignore e.g. shell scripts.  Older versions of
otool would simply print no output on such files, whereas newer releases
print "is not an object file".
2018-05-25 10:57:28 +00:00
jperkin
3a6695c335 check-shlibs-macho.awk: Revert revision 1.3.
It completely broke the checks, resulting in broken binary packages
being shipped, e.g. https://github.com/joyent/pkgsrc/issues/104
2018-05-25 09:26:49 +00:00
triaxx
0ea3f55391 Wrong place to patch readelf 2018-03-23 04:31:53 +00:00
triaxx
317bd14dc5 Fix wrong parsing due to localized readelf on Linux
Linux version of readelf (at least on Arch) translates output
(e.g. "Shared library") and makes the script broken.
2018-03-22 09:37:17 +00:00
rillig
cb09d12497 mk/check/check-relro.mk: explain what RELRO means 2018-03-04 20:45:19 +00:00
jperkin
1605dd1b43 mk: Add support for SSP checks. 2017-10-03 09:43:06 +00:00
wiz
bece876d09 mk: check for installed files that are not in PLIST by default
Previously, this was only enabled with PKG_DEVELOPER.

Ok kamil@ jperkin@
2017-10-02 14:14:04 +00:00
khorben
b6f9200eca Also check for RELRO in shared libraries 2017-07-05 15:49:00 +00:00
khorben
b6e04d7b1c Only check ELF binaries for RELRO 2017-07-05 15:24:22 +00:00
khorben
ca2b8ac385 Implement a check for RELRO
This is only performed if PKG_DEVELOPER and RELRO are in use.

After a suggestion during my talk at BSDCan 2017; thanks!
Also, submitted on tech-pkg@ for review mid-June.

As a next step, it seems this can be extended to libraries, just like the
check for SHLIBS does (from which this is inspired).
2017-07-04 18:29:24 +00:00
prlw1
5c827f6f0e Essentially from OBATA Akio in private mail, June 2015:
Introduce Icon Theme cache handling framework

Icon Theme cache files are used by GTK+ and maintained with the
gtk-update-icon-cache tool.  Each Icon Theme package duplicates
its own maintainance scripts: only the specified icon theme directory
differs.  With this framework, if packages have ICON_THEMES=yes,
associated icon themes will be detected and their cache files will
be maintained automatically.

Change cache handling behaviour as follows:
* Icon theme caches will be updated if either gtk2+ or gtk3+
  gtk-update-icon-cache tool is available.
* With installation of gtk2+ package, not only hicolor icon theme but
  also any other icon theme cache files will be updated.
* Prevent removal of icon caches at deinstall, gtk3+ may be installed and
  using them.
* Ditto with gtk3+, gtk2+ may not be installed now, so caches must be
  maintained by gtk3+.
2017-06-14 16:23:09 +00:00
jlam
0a676f1f26 Provide switch to activate new frameworks to replace "pkginstall".
If ${_USE_NEW_PKGINSTALL} is "yes", then use the new "pkgtasks",
"init", and "pkgformat/pkg"-scripts frameworks instead of the
existing "pkginstall" framework.
2017-06-01 02:15:10 +00:00
jlam
d8e9bb513c Check that some variables have the correct number of words.
Assert MAKE_DIRS_PERMS and OWN_DIRS_PERMS have the right number of
words before using a multivariable .for loop over those variables.
This prevents errors in parsing the makefiles.
2017-05-31 22:56:22 +00:00
jperkin
1421ba461a Introduce CHECK_SHLIBS_BLACKLIST which allows users to specify a list of
regexps that will cause the checks to fail if they match resolved RPATHs.
2017-05-03 13:46:53 +00:00
jperkin
c4f4067d45 Only perform the CHECK_WRKREF_EXTRA_DIRS check on the resolved path rather
than on all of the rpaths.  We can't always exclude the rpath being added,
for example when the compiler adds its own behind our back, so this avoids
false positives.
2017-04-26 11:19:16 +00:00
rillig
e120f955f9 Fixed typo. 2017-04-01 20:55:39 +00:00
adam
99864d3ee3 Fix for otool from Xcode 8.0 2016-08-20 18:52:42 +00:00
joerg
639d5b402f Remove support for USE_DESTDIR=no. 2016-04-10 15:58:02 +00:00
dholland
69936c6955 Explicitly skip directories. PR 50955. 2016-03-11 21:11:47 +00:00
jperkin
640104b74c Reset 'found' variable for each library check. Previously, all subsequent
tests would pass after the first successful check.  Exposes library issues
in a number of packages.
2016-03-10 15:56:24 +00:00
jklos
85563e4143 Fix issue with VAX when awk's split is called with empty string. 2016-02-24 08:54:23 +00:00
jperkin
f946849744 Add an additional check to ensure that library REQUIRES are not relative
paths.  These would previously pass the checks as the files would exist
when checking from within the DESTDIR, but were not resolvable at runtime.
2016-02-19 15:10:23 +00:00
jperkin
454f6fae69 Perform interpreter sed(1) check with LC_ALL=C, avoids failures on newer
Darwin releases with "sed: RE error: illegal byte sequence".
2015-11-27 12:45:04 +00:00
jperkin
266de5d44b Do the "defined && !empty" dance for NetBSD 5 make. 2015-11-24 09:41:20 +00:00
jperkin
c2fe79eceb Add support for CHECK_WRKREF_EXTRA_DIRS to check-shlibs. If "extra" is
listed in CHECK_WRKREF then these directories will added to the checks
for rpath references.
2015-11-16 17:53:29 +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
jperkin
6652f12ad9 Fix check-shlibs regular expression to match .dylib/.sl the same as .so 2015-08-17 16:39:13 +00:00
jperkin
9bf217a5cb Fix typo in local variable name. 2015-08-10 15:11:47 +00:00
jperkin
7ef3ff730f Use a single egrep and regexp instead of iterating over the list of files to
check and calling grep on each of them.  Idea for using ":ts|" from Joerg.

Reduces the test runtime by around 50%, depending on platform and package.
2015-04-29 13:39:43 +00:00
jperkin
bb4c5026e6 Only check executable files for valid interpreters. By the time this check is
performed all installed files should have their correct mode set, and there are
no INSTALL scripts that currently change file modes under PREFIX after
installation (nor should they ever).

This change considerably speeds up the test.  For example in www/firefox-l10n
the time to run the test reduces from 181 seconds (135 seconds of system time)
down to 10 seconds (6 seconds system time) on my SmartOS build systems.
2015-04-29 13:05:28 +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
obache
da209eba3e Drop obsolated old bulk build related variable settings. 2014-11-21 10:46:36 +00:00
joerg
c6e1b83d1b Simplify PKG_DEVELOPER checks. 2014-10-12 23:39:17 +00:00
jperkin
5d44125c9b Cache the results of getline and system() calls. Testing with
x11/kde-workspace4 shows a 25x performance improvement, reducing the
runtime of _check-shlibs from 7m55s to just 18s.
2014-10-03 19:12:16 +00:00
jperkin
d72afedf87 Fix the readelf environment variable. 2014-10-01 08:59:33 +00:00
jperkin
47e3447cf5 Set nrpath correctly in the case where there is no RPATH at all. Fixes
issues seen on NetBSD.
2014-09-07 21:53:41 +00:00
jperkin
800bdaa968 Ensure we iterate over the RPATH in search order, rather than relying on
awk array iteration which could result in the wrong library being chosen.

Fixes issue seen with GCC 4.9 where the libgcc from the main GCC package
was found first and caused errors, even though the RPATH correctly had
the gcc49-libs version listed first.
2014-09-06 16:57:51 +00:00
jperkin
a4e43767b4 Add a 'wrappers' option for CHECK_WRKREF which, if enabled, will check for
references to ${WRAPPER_DIR}.

Update the error message when an invalid CHECK_WRKREF option is used.
2014-09-04 16:09:33 +00:00
richard
8a4981f558 use configured in check-perms 2014-05-09 11:59:27 +00:00
ryoon
370bb25b4d Revert rev. 1.5 2014-03-11 23:27:40 +00:00
ryoon
88465f1339 Revert rev. 1.5 and 1.6
The change introduced in rev. 1.5 disables portability check.
2014-03-11 23:23:01 +00:00