Stefano Lattarini skrev 2012-01-05 10:04:
> On 01/05/2012 01:46 AM, Peter Rosin wrote:
>> Hi!
>>
>> Ok for maint, or should the example be as simple as it can possible get
>> even if portability is sacrificed?
>>
> Are you sure portability is being sacrificed in our example?  I thought that
> the use of `-c' and `-o' together was only required when target-specific flags
> where used (as with e.g. "foo_CPPFLAGS = -DFOO=1").  Am I missing something?

No.  I simply forgot about that.  But while -o (w/o -c) does work for
cl *in this case*, -o has been deprecated for eons (IIRC it was deprecated
at least in MSVC 6, some 10-15 years ago, but perhaps it was deprecated even
before that?) and doesn't work as one would hope (you can't move the output
to some other directory, or something like that).

Anyway, this doesn't look too good (but it works):

$ cl -o hello.exe main.obj
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9035 : option 'o' has been deprecated and will be 
removed in a future release
Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:main.exe
/out:hello.exe
main.obj


While this looks so much better:

$ lib/compile cl -o hello.exe main.obj
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:hello.exe
main.obj


But lets cross the bridge when MS actually removes that option.


> You might also want to look at the test `amhello-binpkg.test'; if it doesn't
> fail when using a compiler that cannot grasp `-c -o' together, then our 
> example
> should have no portability problem.

Right.

Wasted effort, sigh...

Cheers,
Peter

Reply via email to