Fri Oct 27 20:59:59 2017 UTC ()
Set the correct operation mode in the wrapper for as(1)

This notably fixes building lang/g95 with PKGSRC_MKPIE=yes.

Reviewed by joerg@


(khorben)
diff -r1.20 -r1.21 pkgsrc/pkgtools/cwrappers/Makefile
diff -r1.5 -r1.6 pkgsrc/pkgtools/cwrappers/files/bin/Makefile
diff -r1.5 -r1.6 pkgsrc/pkgtools/cwrappers/files/bin/base-wrapper.c
diff -r1.6 -r1.7 pkgsrc/pkgtools/cwrappers/files/bin/common.h
diff -r0 -r1.1 pkgsrc/pkgtools/cwrappers/files/bin/normalise-as.c

cvs diff -r1.20 -r1.21 pkgsrc/pkgtools/cwrappers/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/cwrappers/Makefile 2017/06/11 19:34:43 1.20
+++ pkgsrc/pkgtools/cwrappers/Makefile 2017/10/27 20:59:59 1.21
@@ -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
3PKGNAME= cwrappers-20170611 3PKGNAME= cwrappers-20171027
4CATEGORIES= pkgtools sysutils 4CATEGORIES= pkgtools sysutils
5 5
6MAINTAINER= joerg@NetBSD.org 6MAINTAINER= joerg@NetBSD.org
7HOMEPAGE= http://www.NetBSD.org/ 7HOMEPAGE= http://www.NetBSD.org/
8COMMENT= pkgsrc compiler wrappers 8COMMENT= pkgsrc compiler wrappers
9LICENSE= modified-bsd 9LICENSE= modified-bsd
10 10
11GNU_CONFIGURE= yes 11GNU_CONFIGURE= yes
12USE_BSD_MAKEFILE= yes 12USE_BSD_MAKEFILE= yes
13USE_FEATURES= nbcompat 13USE_FEATURES= nbcompat
14 14
15INSTALLATION_DIRS= libexec/cwrappers 15INSTALLATION_DIRS= libexec/cwrappers
16 16

cvs diff -r1.5 -r1.6 pkgsrc/pkgtools/cwrappers/files/bin/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/cwrappers/files/bin/Makefile 2016/12/09 22:25:28 1.5
+++ pkgsrc/pkgtools/cwrappers/files/bin/Makefile 2017/10/27 20:59:59 1.6
@@ -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#
3PROGS= as-wrapper cc-wrapper c++-wrapper cpp-wrapper f77-wrapper \ 3PROGS= 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
6BINDIR= ${PREFIX}/libexec/cwrappers 6BINDIR= ${PREFIX}/libexec/cwrappers
7 7
8LIB_SRCS= alloc.c cleanup-cc.c common.c reorder-cc.c 8LIB_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
11LIB_SRCS+= mi_vector_hash.c 11LIB_SRCS+= mi_vector_hash.c
12CPPFLAGS+= -DNEED_MI_VECTOR_HASH 12CPPFLAGS+= -DNEED_MI_VECTOR_HASH
13.endif 13.endif
14 14
15LDADD+= -lnbcompat 15LDADD+= -lnbcompat
16 16
17CC_SRCS= ${LIB_SRCS} generic-transform-cc.c normalise-cc.c 17CC_SRCS= ${LIB_SRCS} generic-transform-cc.c normalise-cc.c
18 18
19SRCS.as-wrapper= ${CC_SRCS} as-wrapper.c 19SRCS.as-wrapper= ${CC_SRCS} as-wrapper.c normalise-as.c
20SRCS.cc-wrapper= ${CC_SRCS} cc-wrapper.c transform-cc.c 20SRCS.cc-wrapper= ${CC_SRCS} cc-wrapper.c transform-cc.c
21SRCS.c++-wrapper= ${CC_SRCS} c++-wrapper.c transform-cc.c 21SRCS.c++-wrapper= ${CC_SRCS} c++-wrapper.c transform-cc.c
22SRCS.cpp-wrapper= ${CC_SRCS} cpp-wrapper.c 22SRCS.cpp-wrapper= ${CC_SRCS} cpp-wrapper.c
23SRCS.f77-wrapper= ${CC_SRCS} f77-wrapper.c 23SRCS.f77-wrapper= ${CC_SRCS} f77-wrapper.c
24SRCS.imake-wrapper= ${CC_SRCS} imake-wrapper.c 24SRCS.imake-wrapper= ${CC_SRCS} imake-wrapper.c
25SRCS.ld-wrapper= ${LIB_SRCS} generic-transform-ld.c \ 25SRCS.ld-wrapper= ${LIB_SRCS} generic-transform-ld.c \
26 normalise-ld.c ld-wrapper.c 26 normalise-ld.c ld-wrapper.c
27SRCS.libtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \ 27SRCS.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
29SRCS.shlibtool-wrapper= ${LIB_SRCS} generic-transform-libtool.c \ 29SRCS.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
32WARNS= 4 32WARNS= 4

cvs diff -r1.5 -r1.6 pkgsrc/pkgtools/cwrappers/files/bin/base-wrapper.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/cwrappers/files/bin/base-wrapper.c 2017/06/11 19:34:43 1.5
+++ pkgsrc/pkgtools/cwrappers/files/bin/base-wrapper.c 2017/10/27 20:59:59 1.6
@@ -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);

cvs diff -r1.6 -r1.7 pkgsrc/pkgtools/cwrappers/files/bin/common.h (expand / switch to unified diff)

--- pkgsrc/pkgtools/cwrappers/files/bin/common.h 2017/06/11 19:34:43 1.6
+++ pkgsrc/pkgtools/cwrappers/files/bin/common.h 2017/10/27 20:59:59 1.7
@@ -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
86char *xasprintf(const char *, ...) 86char *xasprintf(const char *, ...)
87 __attribute__((__format__(__printf__, 1, 2))); 87 __attribute__((__format__(__printf__, 1, 2)));
88#else 88#else
89char *xasprintf(const char *, ...); 89char *xasprintf(const char *, ...);
90#endif 90#endif
91 91
92void *xmalloc(size_t); 92void *xmalloc(size_t);
93void *xrealloc(void *, size_t); 93void *xrealloc(void *, size_t);
94char *xstrdup(const char *); 94char *xstrdup(const char *);
95char *xstrndup(const char *, size_t); 95char *xstrndup(const char *, size_t);
96 96
 97void operation_mode_as(void);
 98
97void operation_mode_cc(struct arglist *); 99void operation_mode_cc(struct arglist *);
98void normalise_cc(struct arglist *); 100void normalise_cc(struct arglist *);
99void cleanup_cc(struct arglist *args); 101void cleanup_cc(struct arglist *args);
100void transform_cc(struct arglist *args); 102void transform_cc(struct arglist *args);
101 103
102void register_reorder(const char *); 104void register_reorder(const char *);
103void reorder_cc(struct arglist *); 105void reorder_cc(struct arglist *);
104 106
105void init_generic_transform(void); 107void init_generic_transform(void);
106void register_generic_transform(const char *); 108void register_generic_transform(const char *);
107void generic_transform_cc(struct arglist *); 109void generic_transform_cc(struct arglist *);
108 110
109void operation_mode_ld(struct arglist *); 111void operation_mode_ld(struct arglist *);

File Added: pkgsrc/pkgtools/cwrappers/files/bin/normalise-as.c
/* $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;
}