Commit graph

265 commits

Author SHA1 Message Date
joerg
f3c5583abd On AIX don't overwrite the XLC definitions with the platform logic, the
former are already more specific.
2008-10-30 18:56:22 +00:00
sketch
3d4e973b41 Add a bunch of supported options. 2008-06-17 12:58:28 +00:00
joerg
40630f325d Revert rev 1.3 as it breaks e.g. -Wl,--whole-archive. See PR 38476 for
details.
2008-04-21 14:43:50 +00:00
kim
d105f33986 Keep libraries specified as .a files in their original position among
other libraries (specified with -l).

Fixes a linking problem in net-snmp, where the Perl DynaLoader.a library
becomes out-of-order when all -l arguments have been moved to the end of
the command line.
2008-04-20 12:24:21 +00:00
tnn
e6872cea49 Add IRIX command sinks, needed to get rpath fixup when using GCC. 2008-02-19 17:36:51 +00:00
tnn
f0462b82fe Pass gcc's -mabi=* option (used on mips) without warning. 2008-02-19 16:50:11 +00:00
rillig
410affab94 Do not load the $cache file for every argument. Instead, load it once
and then call it as a shell function. Note that the shell function is
not called "cache", since some shells have problems when a function has
the same name as a variable.

This speeds up the wrapper by as little as 75 percent for the final link
command of editors/abiword on SunOS-5.10-sparc (before: 20 seconds,
after: 5 seconds).
2007-11-28 14:45:22 +00:00
rillig
73b5319da9 Oops, don't overflow the terminal. 2007-11-28 13:18:50 +00:00
rillig
b9163bca81 sunpro doesn't need -lstdc++. 2007-11-28 13:03:56 +00:00
rillig
ba3e0729b2 Using a single awk process instead of a pipe of four grep processes
should be both faster and easier to read.
2007-11-28 12:57:46 +00:00
rillig
89870d4887 Sunpro doesn't need -rdynamic, since the linker is sensible by default.
This change also works around shells/scsh's broken check for -rdynamic.
2007-11-19 00:45:49 +00:00
he
4c77b0e4fd Preserve the -Wl,-Bstatic / -Wl,-Bdynamic arguments, but also
duplicate them into the list of libraries.  Someone may want to mix
static and dynamic linking.

Fixes PR#37228, approved by jlam.

jlam says that a better long-term fix would be to ensure that all
the -L specifications come before the -l specifications, instead
of moving all the -l specifications to the end of the command line.
2007-11-08 17:38:17 +00:00
rillig
5fba458aef sunpro doesn't know -ggdb. 2007-11-01 14:31:03 +00:00
is
0596912f74 Handle more variants of the position independent code flag from Solaris.
This is needed for Xaw3d. Fix suggested by joerg@.
2007-10-17 07:30:10 +00:00
martti
bd986edbc7 Remove trailing spaces. 2007-10-09 19:19:08 +00:00
joerg
d05706a374 When linking with XLC on AIX, force -brtl to get linkage behaviour we
expect from other platforms.
2007-10-05 18:19:45 +00:00
rillig
553d52ca88 When CPP is defined as "cc -E", the wrapper framework created the
wrapper for gcc and cc as type "CPP", although these aren't C
preprocessors. By preventing the code from overwriting files, this works
now.
2007-09-20 18:17:18 +00:00
rillig
4334ec644a Fixed incorrect quoting of arguments. This behavior had been unnoticed
for several years now, since the directories in the -I... and -L...
options usually don't need quoting. But when the -D... option was
processed using the same code, the bug had become visible.
2007-09-19 13:08:19 +00:00
rillig
e446929efd Before and after the transformations, the commands are written to the
log file in a format that allows copy-and-paste into a shell. Before, it
wasn't possible to see from the log file whether a space was a delimiter
or part of a shell word.
2007-09-19 13:02:15 +00:00
rillig
2e36f667a2 The word "skipped" is ambiguous. Use "untransformed" instead. 2007-09-13 10:50:43 +00:00
rillig
f4afca78cc Merge -D and the following word, so -D UNIX -D WHATEVER doesn't get
transformed to -D UNIX WHATEVER (because the wrapper eliminates
duplicate arguments). Now it becomes -DUNIX -DWHATEVER. This fixes a
build problem reported in
http://mail-index.netbsd.org/pkgsrc-users/2007/09/10/0004.html.
2007-09-11 08:33:11 +00:00
rillig
1bd0ba21be gcc knows -fpic. 2007-09-08 13:37:51 +00:00
joerg
005620851f Add core of the infrastructure support for cross-compilation.
- USE_CROSS_COMPILATION activates it, CROSS_DESTDIR specifies root of
  the target filesystem
- derive _CROSS_DESTDIR from CROSS_DESTDIR or MAKEOBJDIR
- buildlink3.mk prefixes the files to symlink with _CROSS_DESTDIR
- compiler/gcc.mk knows about the target prefix (e.g. i386--netbsdelf)
- PKG_DBDIR is prefixed with _CROSS_DESTDIR
- package-install and bin-install are not called with su
- install and strip are redirected to the tool version
- links for the target specific ar, as, ld, nm, objdump, ranlib and
  strip are added
- compiler wrapper detect if linking is requested or not
- special command sinks for CPP and CC/CXX add the cross-compile magic:
  - modify include dirs to get the target /usr/include
  - modify linker dirs and runpath to use target /usr/lib at link time,
    but keep correct rpath entries

Supported-by: Google SoC 2007
Basic tests by he@ on Sparc. Review from jlam@.
2007-08-02 18:19:31 +00:00
rillig
a43d0cbe68 Changed the plain "mkdir" into ${MKDIR}, like in all the other cases.
Apparently, the tools directory isn't in the PATH at the point where
this code is executed.

Fixes PR 35487.
2007-06-18 07:33:34 +00:00
rillig
3c335872b8 Added transformations for -R, -fPIC, -kPIC, -KPIC and -g3. 2007-06-15 15:34:31 +00:00
rillig
4a8946c97e Added a slight variation of the patch provided in PR 36187 by Naoto
Morishima.
2007-06-09 11:27:33 +00:00
rillig
287ae72163 Replaced ${_PKG_SILENT}${_PKG_DEBUG} with a simple ${RUN} to save some
space.
2007-06-06 13:20:34 +00:00
martti
5867247b54 Remove trailing spaces. 2007-05-28 11:07:00 +00:00
rillig
a5f2e60928 When a wrapped compiler or linker command fails, the transformed command
line is no longer printed by default. To get that behavior back, you can
set the variable WRAPPER_DEBUG to "yes".

This avoids some noise during the build. The old behavior was mostly
useful on Solaris and IRIX, where a -std=c99 or -c99 option had been
added to the compiler's arguments by the wrapper. This caused
diagnostics that were hard to understand, since the user did not specify
these flags and there was no sign that they had been added.
2007-05-19 17:25:56 +00:00
tnn
c7d09b8f3c Back out previous. The packages that incorrectly assume that ld
--version-script works are few enough to warrant fixing each one of them
instead. Silenty dropping the flag makes it impossible to detect whether or
not --version-script is supported. Pointed out by joerg@
2007-05-06 10:05:38 +00:00
tnn
417f311e41 --version-script is GNU ld specific, remove from command line. 2007-04-29 13:16:48 +00:00
tnn
305f2d4288 Correct comment about -g3 flag. 2007-04-28 21:32:30 +00:00
tnn
5246b02f93 Handle linker optimization flag. 2007-04-22 18:56:22 +00:00
tnn
89d0487fe0 fix typo 2007-04-21 14:53:19 +00:00
tnn
cf0d723c6f add workaround for ld(1) run path problems and document those 2007-04-21 01:29:25 +00:00
tnn
146da1286c Teach pkgsrc about HP-UX. 2007-04-14 14:17:49 +00:00
tnn
2df0aa35f6 Add OSF1 wrapper quirks to always enable posix sockets and iso C++ iostreams.
Fixes PR 31444. Fixes PR 31447. Both problems reported by Rumi Szabolcs.
2007-04-12 14:51:10 +00:00
rillig
f98d016454 + -march=* 2007-04-10 03:44:34 +00:00
tron
aef83eee53 Remove special treatment of "DynaLoader.a" completely. It's not necessary
with current libtool version and breaks the build under Darwin 8.x and
NetBSD 4.0_BETA2.
2007-04-09 22:33:26 +00:00
rillig
b422be0f7a wrapper_type can be IMAKE, too. 2007-03-15 22:09:29 +00:00
rillig
1ceda05973 Added the flags to control diagnostics. 2007-03-07 22:02:34 +00:00
rillig
ca73e90164 Fixed the documentation of the opt:*:* transformation. 2007-03-07 12:40:54 +00:00
rillig
215797f36f The compiler option -Wl,foo,bar,baz is split into -Wl,foo -Wl,bar
-Wl,baz before processing the resulting options again.

Fixes PR 32203.
2007-02-23 00:31:29 +00:00
rillig
7cdc72c444 Changed the default warning message to include the word "unknown", since
otherwise it doesn't sound like a warning.
2007-02-22 14:54:32 +00:00
rillig
6699eeb63a More documentation. 2007-02-22 07:15:54 +00:00
rillig
1b99f46aad gcc understands -Wno-unused-parameter. 2007-02-21 19:29:56 +00:00
rillig
4d2476efa1 Changed the failure into a warning when options such as "-I -L" appear
next to each other.
2007-02-21 12:27:36 +00:00
rillig
a0dd1a37e7 The options -I, -L and -R must not be followed directly by another
option. Instead of just merging them, the wrapper fails. Let's see which
packages get broken by that and then fix them.

I've also heard rumours that a plain -L is used as an alias to -nostdlib
in some compilers. This would have been handled wrong up to now, since
it definitely wasn't intended to be merged with the following argument.
2007-02-21 09:43:26 +00:00
rillig
f1bc7a1210 Mapping command line options to the ABI is not as simple as I thought:
-32 does _not_ belong to ABI 32. Instead, the mapping is:

	ABI	Options
	(undef)	-o32 -32
	32	-n32
	64	-64

While here, allowing -OPT:* to pass through to the compiler, since it
will understand it.

This should fix PR 35729.
2007-02-20 16:12:41 +00:00
rillig
5495a908a1 The ABI for which the code should be generated can be queried from the
wrapper_abi variable. This is used in the MIPSpro wrapper to reject any
package that tries to compile a file for the wrong ABI. This is not just
a warning because such a package most likely has more severe problems.

The gcc -Wall option seems to be similar to the MIPSpro -fullwarn
option, so map them.
2007-02-19 14:50:33 +00:00
rillig
b157602e03 The argument -64 means to use the 64-bit ABI for Sun C and MIPSpro. 2007-02-19 14:43:05 +00:00
rillig
ecb69be79f The mipspro compiler knows -32, -n32 and -64, of course. 2007-02-18 23:59:57 +00:00
rillig
ea5e7c8c6d Documented WRAPPER_REORDER_CMDS. 2007-02-18 23:49:44 +00:00
rillig
96a2636f64 Added option handlers for all of -fPIC, -fpic, -KPIC, -kPIC,
-xcode=pic13 and -xcode=pic32, as suggested in PR 35555.

This also fixes and old bug where -fPIC (32 bit) had been translated to
-kpic (13 bit), but apparently that doesn't make a big difference in
practice.
2007-02-07 18:25:29 +00:00
rillig
fdd5258a69 Added a new variable wrapper_type to the wrappers, so that the
transformations can decide whether they happen in a C or a C++ compiler.
Now the wrappers don't depend on the basename of the executed compiler
wrapper anymore.

Fixes PR 35555.
2007-02-06 20:33:50 +00:00
rillig
f705bc4de8 Some more gcc options I've found on Solaris. 2007-02-06 20:26:51 +00:00
rillig
8bae16fa25 More gcc options. 2007-02-06 19:35:41 +00:00
rillig
6cd528c1df The sunpro C++ compiler needs its own cache, since cc and CC transform
-Wall to different arguments.
2007-01-17 13:20:56 +00:00
rillig
a440d183a7 The sunpro wrapper needs to distinguish whether cc or CC is called in
some cases.

XXX: There should be more support in the infrastructure for this case.
2007-01-17 13:19:47 +00:00
rillig
faba91bc57 Options to subprocesses like the assember must pass the transformations.
They are _not_ GCC warnings, although they start with -W.
2007-01-14 18:56:25 +00:00
rillig
78860dce69 Fixed a syntax error. 2007-01-08 14:01:41 +00:00
rillig
91f388696d MIPSpro knows the -c99, -M and -MDupdate options. 2007-01-08 12:09:47 +00:00
rillig
65c174f9e0 Added some more flags that gcc definitely knows, to reduce the number of
warnings.
2007-01-06 02:20:10 +00:00
rillig
dfc54f4c6a Bugfix: Only regular files can be unwrapped. 2007-01-04 00:57:29 +00:00
rillig
37ab58e7c0 Added an "eval" to make the <*> line look like the [*] line, in terms of
the quoting level. It had contained too many backslashes before, which
has led to confusion, at least for me.
2007-01-02 17:13:59 +00:00
rillig
5aceb423df Some of the SunPro compilers (cc, c89) cannot handle the -O0 and -O1
options. Some others (c99, CC) can. To avoid linker errors about
"illegal option -- 1", these options are converted to -xO0 and -xO1,
which work.

Committed during the freeze to avoid breakage of packages. The code that
passed the -O0 and -O1 options through is relatively new, so there may
not have shown packages that break because of this.
2006-12-18 00:21:31 +00:00
martti
e2610fb8c8 Remove trailing tabs. 2006-12-15 13:15:06 +00:00
martti
2cc4216d5e Remove trailing spaces. 2006-12-15 12:46:23 +00:00
dmcmahill
725c4c50a3 Add a --wrappee-name command line option to simply return the name of
the wrapped command and exit.  This will be used by libtool which needs
to figure out the true command name.  Yeah, it is ugly behaviour from
libtool, but I'm not going to rewrite libtool.

Change ok-ed by jlam.
2006-12-14 22:25:19 +00:00
rillig
af345e7eb3 Converted to using the functions from wrapper-subr.sh. 2006-12-10 03:14:59 +00:00
rillig
7bd351d3ea + -M 2006-12-10 00:18:17 +00:00
rillig
c0db9bdc6f Added a small program to test a single transformation plug-in. 2006-12-09 12:42:43 +00:00
rillig
ec0abe202c Since the wrapper transformations are usually quite hard to follow and
may lead to failure for some packages, a note to the user is printed
when a wrapped command fails, including the "real" command line of the
wrapped command.

This change arose from the implicit addition of the -std=c99, -std=gnu99
or -c99 options, which made some packages fail with obscure error
messages. This change helps users get to the real cause more quickly.
2006-12-09 12:11:28 +00:00
rillig
7bf0660e71 + -fno-implicit-templates
+ -MM
2006-12-09 12:06:55 +00:00
rillig
697899fc00 The SunPro C++ compiler knows the -template=* option. 2006-12-08 05:35:55 +00:00
rillig
7a051744ac + -Wcast-align 2006-12-07 00:32:36 +00:00
rillig
fdc2194469 SunPro knows the -mt option for enabling multi-threaded options. 2006-12-05 22:29:27 +00:00
rillig
4304993eda Added -pipe and -Wno-implicit-int to the list of known gcc options. 2006-12-01 21:10:18 +00:00
rillig
1815e3e939 Converted the MIPSpro wrappers to use the transform_* functions. 2006-11-30 13:00:16 +00:00
rillig
aac372bd8c The function transform_pass_with_warning() also gets its debugging
output.
2006-11-30 12:59:56 +00:00
rillig
7ec0b5c018 Adjusted the indentation and the order of checks to match the other
files.
2006-11-30 12:49:57 +00:00
rillig
cb46105231 Made the code simpler by converting it to the new transform_* functions.
A warning is printed whenever unknown options are passed.
2006-11-30 12:34:30 +00:00
rillig
7034ce594b Added handlers for the standard options.
A warning is printed for all options that are not explicitly handled.

Reindentation to align with the other files.
2006-11-30 12:18:32 +00:00
rillig
210a609939 Removed the transform_to_nocache() function, since it is unused.
When discarding arguments, split_arg is set to yes, so that no empty
arguments are added to the resulting command line. A more informative
debugging message is also printed in that case.

Added a debugging message to transform_to(), for consistency with the
other functions.
2006-11-30 12:11:48 +00:00
rillig
d20919c301 Converted to use the new transform_* functions from wrapper-subr.sh. 2006-11-30 11:51:39 +00:00
rillig
d997c2fb01 Added transform_to_and_split(), which removes the need for the
compiler-specific transformations to access the split_arg variable
directly.
2006-11-30 11:40:24 +00:00
rillig
87d17f2abb Minor reformatting. I'm still not sure what the ideal indentation and
source code layout is. But at least, this file looks to me as if even
newbies could see where to change it to fit their needs.
2006-11-30 11:34:23 +00:00
rillig
91dbddf79f Reformatted the file to look more beautiful.
Reordered the compiler options to catch the standard ones first.
2006-11-30 10:01:29 +00:00
rillig
4b93d3ead2 The -E option should be passed to SunPro without a warning. 2006-11-29 17:36:15 +00:00
rillig
0d6ef4486f Removed the separate files for the cache header and footer. This makes
the code a lot more readable.
2006-11-26 14:42:17 +00:00
rillig
ba242d18aa Found some more known options for gcc. 2006-11-26 14:39:52 +00:00
rillig
1bffa7c999 Merged the transformations from the Solaris-specific gcc part into the
generic one. That way, the unknown options are reported properly on all
platforms.
2006-11-26 13:02:53 +00:00
rillig
6a7a034b39 Converted this file to use the shell functions provided in
wrapper-subr.sh.
2006-11-26 13:00:26 +00:00
rillig
9257944253 Oops, unknown options should be _passed_ to the real compiler, not
_discarded_.
2006-11-26 10:00:04 +00:00
rillig
2e410b3409 Added a transformation file for gcc to check for unknown options. 2006-11-26 09:56:46 +00:00
rillig
414d0506c0 Renamed transform_pass_unknown to transform_pass_with_warning and added
transform_discard_with_warning.
2006-11-26 09:55:52 +00:00
rillig
627712c574 transform_pass_unknown writes its warning into the wrapper log file,
instead of doing nothing at all. (Before, I had not known where to write
these warnings, so it had been commented out.)
2006-11-26 09:13:44 +00:00
rillig
2681aeb95a Moved the definition of append_extra_args a bit to make the code a
little more understandable.

Eliminated the otherwise unused variable original_cmd.
2006-11-26 08:42:42 +00:00
rillig
9ba5e8c4e3 Fixed indentation of the debugging messages and the missing newline at
the end of the file.
2006-11-14 13:40:20 +00:00
rillig
c9f593bcde Converted the SunPro wrapper to use the functions from wrapper-subr.sh.
Added some code to check for unknown options.

Reindented the file so that the compiler options are better visible.
They had been hidden by the massive block comments before. Also, every
option has got its own line so that one only needs to read the first
column to find the relevant code.
2006-11-11 07:50:28 +00:00