Set the correct operation mode in the wrapper for as(1) This notably fixes building lang/g95 with PKGSRC_MKPIE=yes. Reviewed by joerg@diff -r1.20 -r1.21 pkgsrc/pkgtools/cwrappers/Makefile
(khorben)
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | # $NetBSD: Makefile,v 1.20 2017/06/11 19:34:43 joerg Exp $ | 1 | # $NetBSD: Makefile,v 1.21 2017/10/27 20:59:59 khorben Exp $ | |
2 | 2 | |||
3 | PKGNAME= cwrappers-20170611 | 3 | PKGNAME= cwrappers-20171027 | |
4 | CATEGORIES= pkgtools sysutils | 4 | CATEGORIES= pkgtools sysutils | |
5 | 5 | |||
6 | MAINTAINER= joerg@NetBSD.org | 6 | MAINTAINER= joerg@NetBSD.org | |
7 | HOMEPAGE= http://www.NetBSD.org/ | 7 | HOMEPAGE= http://www.NetBSD.org/ | |
8 | COMMENT= pkgsrc compiler wrappers | 8 | COMMENT= pkgsrc compiler wrappers | |
9 | LICENSE= modified-bsd | 9 | LICENSE= modified-bsd | |
10 | 10 | |||
11 | GNU_CONFIGURE= yes | 11 | GNU_CONFIGURE= yes | |
12 | USE_BSD_MAKEFILE= yes | 12 | USE_BSD_MAKEFILE= yes | |
13 | USE_FEATURES= nbcompat | 13 | USE_FEATURES= nbcompat | |
14 | 14 | |||
15 | INSTALLATION_DIRS= libexec/cwrappers | 15 | INSTALLATION_DIRS= libexec/cwrappers | |
16 | 16 |
@@ -1,32 +1,32 @@ | @@ -1,32 +1,32 @@ | |||
1 | # $NetBSD: Makefile,v 1.5 2016/12/09 22:25:28 joerg Exp $ | 1 | # $NetBSD: Makefile,v 1.6 2017/10/27 20:59:59 khorben Exp $ | |
2 | # | 2 | # | |
3 | PROGS= as-wrapper cc-wrapper c++-wrapper cpp-wrapper f77-wrapper \ | 3 | PROGS= as-wrapper cc-wrapper c++-wrapper cpp-wrapper f77-wrapper \ | |
4 | imake-wrapper ld-wrapper libtool-wrapper shlibtool-wrapper | 4 | imake-wrapper ld-wrapper libtool-wrapper shlibtool-wrapper | |
5 | 5 | |||
6 | BINDIR= ${PREFIX}/libexec/cwrappers | 6 | BINDIR= ${PREFIX}/libexec/cwrappers | |
7 | 7 | |||
8 | LIB_SRCS= alloc.c cleanup-cc.c common.c reorder-cc.c | 8 | LIB_SRCS= alloc.c cleanup-cc.c common.c reorder-cc.c | |
9 | 9 | |||
10 | .ifdef NEED_MI_VECTOR_HASH | 10 | .ifdef NEED_MI_VECTOR_HASH | |
11 | LIB_SRCS+= mi_vector_hash.c | 11 | LIB_SRCS+= mi_vector_hash.c | |
12 | CPPFLAGS+= -DNEED_MI_VECTOR_HASH | 12 | CPPFLAGS+= -DNEED_MI_VECTOR_HASH | |
13 | .endif | 13 | .endif | |
14 | 14 | |||
15 | LDADD+= -lnbcompat | 15 | LDADD+= -lnbcompat | |
16 | 16 | |||
17 | CC_SRCS= ${LIB_SRCS} generic-transform-cc.c normalise-cc.c | 17 | CC_SRCS= ${LIB_SRCS} generic-transform-cc.c normalise-cc.c | |
18 | 18 | |||
19 | SRCS.as-wrapper= ${CC_SRCS} as-wrapper.c | 19 | SRCS.as-wrapper= ${CC_SRCS} as-wrapper.c normalise-as.c | |
20 | SRCS.cc-wrapper= ${CC_SRCS} cc-wrapper.c transform-cc.c | 20 | SRCS.cc-wrapper= ${CC_SRCS} cc-wrapper.c transform-cc.c | |
21 | SRCS.c++-wrapper= ${CC_SRCS} c++-wrapper.c transform-cc.c | 21 | SRCS.c++-wrapper= ${CC_SRCS} c++-wrapper.c transform-cc.c | |
22 | SRCS.cpp-wrapper= ${CC_SRCS} cpp-wrapper.c | 22 | SRCS.cpp-wrapper= ${CC_SRCS} cpp-wrapper.c | |
23 | SRCS.f77-wrapper= ${CC_SRCS} f77-wrapper.c | 23 | SRCS.f77-wrapper= ${CC_SRCS} f77-wrapper.c | |
24 | SRCS.imake-wrapper= ${CC_SRCS} imake-wrapper.c | 24 | SRCS.imake-wrapper= ${CC_SRCS} imake-wrapper.c | |
25 | SRCS.ld-wrapper= ${LIB_SRCS} generic-transform-ld.c \ | 25 | SRCS.ld-wrapper= ${LIB_SRCS} generic-transform-ld.c \ | |
26 | normalise-ld.c ld-wrapper.c | 26 | normalise-ld.c ld-wrapper.c | |
27 | SRCS.libtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \ | 27 | SRCS.libtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \ | |
28 | normalise-cc.c libtool-wrapper.c fixup-libtool.c | 28 | normalise-cc.c libtool-wrapper.c fixup-libtool.c | |
29 | SRCS.shlibtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \ | 29 | SRCS.shlibtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \ | |
30 | normalise-cc.c shlibtool-wrapper.c fixup-libtool.c | 30 | normalise-cc.c shlibtool-wrapper.c fixup-libtool.c | |
31 | 31 | |||
32 | WARNS= 4 | 32 | WARNS= 4 |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: base-wrapper.c,v 1.5 2017/06/11 19:34:43 joerg Exp $ */ | 1 | /* $NetBSD: base-wrapper.c,v 1.6 2017/10/27 20:59:59 khorben Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007, 2017 Joerg Sonnenberger <joerg@NetBSD.org>. | 4 | * Copyright (c) 2007, 2017 Joerg Sonnenberger <joerg@NetBSD.org>. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code was developed as part of Google's Summer of Code 2007 program. | 7 | * This code was developed as part of Google's Summer of Code 2007 program. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * | 12 | * | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -118,27 +118,29 @@ main(int argc, char **argv) | @@ -118,27 +118,29 @@ main(int argc, char **argv) | |||
118 | return 0; | 118 | return 0; | |
119 | } | 119 | } | |
120 | 120 | |||
121 | arglist_from_argc(&args, argc, argv); | 121 | arglist_from_argc(&args, argc, argv); | |
122 | 122 | |||
123 | fp = worklog_open(); | 123 | fp = worklog_open(); | |
124 | worklog_cmd(fp, "[*]", wrapper_name, &args); | 124 | worklog_cmd(fp, "[*]", wrapper_name, &args); | |
125 | 125 | |||
126 | #if defined(WRAPPER_LIBTOOL) || defined(WRAPPER_SHLIBTOOL) | 126 | #if defined(WRAPPER_LIBTOOL) || defined(WRAPPER_SHLIBTOOL) | |
127 | if (libtool_mode(&args)) | 127 | if (libtool_mode(&args)) | |
128 | goto skip_transforms; | 128 | goto skip_transforms; | |
129 | #endif | 129 | #endif | |
130 | 130 | |||
131 | #if defined(WRAPPER_LD) | 131 | #if defined(WRAPPER_AS) | |
132 | operation_mode_as(); | |||
133 | #elif defined(WRAPPER_LD) | |||
132 | operation_mode_ld(&args); | 134 | operation_mode_ld(&args); | |
133 | #else | 135 | #else | |
134 | operation_mode_cc(&args); | 136 | operation_mode_cc(&args); | |
135 | #endif | 137 | #endif | |
136 | arglist_apply_config(&args); | 138 | arglist_apply_config(&args); | |
137 | #if defined(WRAPPER_LD) | 139 | #if defined(WRAPPER_LD) | |
138 | normalise_ld(&args); | 140 | normalise_ld(&args); | |
139 | #else | 141 | #else | |
140 | normalise_cc(&args); | 142 | normalise_cc(&args); | |
141 | #endif | 143 | #endif | |
142 | cleanup_cc(&args); | 144 | cleanup_cc(&args); | |
143 | #if defined(WRAPPER_LD) | 145 | #if defined(WRAPPER_LD) | |
144 | generic_transform_ld(&args); | 146 | generic_transform_ld(&args); |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: common.h,v 1.6 2017/06/11 19:34:43 joerg Exp $ */ | 1 | /* $NetBSD: common.h,v 1.7 2017/10/27 20:59:59 khorben Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2009, 2017 Joerg Sonnenberger <joerg@NetBSD.org>. | 4 | * Copyright (c) 2009, 2017 Joerg Sonnenberger <joerg@NetBSD.org>. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * | 10 | * | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in | 14 | * notice, this list of conditions and the following disclaimer in | |
@@ -84,26 +84,28 @@ void worklog_cmd(FILE *, const char *, c | @@ -84,26 +84,28 @@ void worklog_cmd(FILE *, const char *, c | |||
84 | 84 | |||
85 | #if defined(__GNUC__) && __GNUC__ >= 2 | 85 | #if defined(__GNUC__) && __GNUC__ >= 2 | |
86 | char *xasprintf(const char *, ...) | 86 | char *xasprintf(const char *, ...) | |
87 | __attribute__((__format__(__printf__, 1, 2))); | 87 | __attribute__((__format__(__printf__, 1, 2))); | |
88 | #else | 88 | #else | |
89 | char *xasprintf(const char *, ...); | 89 | char *xasprintf(const char *, ...); | |
90 | #endif | 90 | #endif | |
91 | 91 | |||
92 | void *xmalloc(size_t); | 92 | void *xmalloc(size_t); | |
93 | void *xrealloc(void *, size_t); | 93 | void *xrealloc(void *, size_t); | |
94 | char *xstrdup(const char *); | 94 | char *xstrdup(const char *); | |
95 | char *xstrndup(const char *, size_t); | 95 | char *xstrndup(const char *, size_t); | |
96 | 96 | |||
97 | void operation_mode_as(void); | |||
98 | ||||
97 | void operation_mode_cc(struct arglist *); | 99 | void operation_mode_cc(struct arglist *); | |
98 | void normalise_cc(struct arglist *); | 100 | void normalise_cc(struct arglist *); | |
99 | void cleanup_cc(struct arglist *args); | 101 | void cleanup_cc(struct arglist *args); | |
100 | void transform_cc(struct arglist *args); | 102 | void transform_cc(struct arglist *args); | |
101 | 103 | |||
102 | void register_reorder(const char *); | 104 | void register_reorder(const char *); | |
103 | void reorder_cc(struct arglist *); | 105 | void reorder_cc(struct arglist *); | |
104 | 106 | |||
105 | void init_generic_transform(void); | 107 | void init_generic_transform(void); | |
106 | void register_generic_transform(const char *); | 108 | void register_generic_transform(const char *); | |
107 | void generic_transform_cc(struct arglist *); | 109 | void generic_transform_cc(struct arglist *); | |
108 | 110 | |||
109 | void operation_mode_ld(struct arglist *); | 111 | void operation_mode_ld(struct arglist *); |
/* $NetBSD: normalise-as.c,v 1.1 2017/10/27 20:59:59 khorben Exp $ */
/*-
* Copyright (c) 2017 Pierre Pronchery <khorben@defora.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "common.h"
void
operation_mode_as(void)
{
current_operation_mode = mode_assemble;
}