pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/cwrappers/files/bin Teach the wrapper for ld(...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/82dcdb20541c
branches:  trunk
changeset: 371219:82dcdb20541c
user:      khorben <khorben%pkgsrc.org@localhost>
date:      Tue Nov 07 16:49:22 2017 +0000

description:
Teach the wrapper for ld(1) about more cases

Building relocatable and omagic files are now recognized. They were
previously recognized as executables, which may require a different
behaviour in some environments (like when enforcing PIE).

Committing this before joerg@'s approval since a call for testing
PKGSRC_MKPIE has just been issued, and this helps with some packages.

diffstat:

 pkgtools/cwrappers/files/bin/common.h       |   4 +++-
 pkgtools/cwrappers/files/bin/normalise-ld.c |  12 +++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 9395aa35f8ed -r 82dcdb20541c pkgtools/cwrappers/files/bin/common.h
--- a/pkgtools/cwrappers/files/bin/common.h     Tue Nov 07 15:53:11 2017 +0000
+++ b/pkgtools/cwrappers/files/bin/common.h     Tue Nov 07 16:49:22 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: common.h,v 1.7 2017/10/27 20:59:59 khorben Exp $ */
+/* $NetBSD: common.h,v 1.8 2017/11/07 16:49:22 khorben Exp $ */
 
 /*-
  * Copyright (c) 2009, 2017 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -50,6 +50,8 @@
        mode_assemble,
        mode_compile,
        mode_link_executable,
+       mode_link_omagic,
+       mode_link_relocatable,
        mode_link_shared
 };
 extern enum operation_mode current_operation_mode;
diff -r 9395aa35f8ed -r 82dcdb20541c pkgtools/cwrappers/files/bin/normalise-ld.c
--- a/pkgtools/cwrappers/files/bin/normalise-ld.c       Tue Nov 07 15:53:11 2017 +0000
+++ b/pkgtools/cwrappers/files/bin/normalise-ld.c       Tue Nov 07 16:49:22 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: normalise-ld.c,v 1.3 2017/06/11 19:34:43 joerg Exp $ */
+/* $NetBSD: normalise-ld.c,v 1.4 2017/11/07 16:49:22 khorben Exp $ */
 
 /*-
  * Copyright (c) 2009, 2017 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -44,6 +44,16 @@
        TAILQ_FOREACH(arg, args, link) {
                if (arg->val[0] != '-')
                        continue;
+               if (strcmp(arg->val, "-N") == 0 ||
+                   strcmp(arg->val, "--omagic") == 0) {
+                       current_operation_mode = mode_link_omagic;
+                       continue;
+               }
+               if (strcmp(arg->val, "-r") == 0 ||
+                   strcmp(arg->val, "--relocatable") == 0) {
+                       current_operation_mode = mode_link_relocatable;
+                       continue;
+               }
                if (strcmp(arg->val, "-shared") == 0 ||
                    strcmp(arg->val, "-Bshareable") == 0) {
                        current_operation_mode = mode_link_shared;



Home | Main Index | Thread Index | Old Index