How to pass link option at Windows build?

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Mon Mar 16 13:42:29 UTC 2020


On 2020-03-15 18:52, Robert Lu wrote:
> Hi,
> I am trying to build JDK at Windows 10, with cl 19.24.28316 for x64.
> I want to build a JDK without ASLR,which needs to set link option /FIXED.
>
> so I tried these options:
> bash ./configure --with-debug-level=fastdebug
> --with-extra-cflags="/DYNAMICBASE:NO /link /FIXED"
> --with-extra-cxxflags="/DYNAMICBASE:NO /link /FIXED"
>   --with-extra-ldflags="/FIXED"

Use "-fixed" and "-link" instead. Microsoft's compilers allow the 
(standard-everywhere-else) dash instead of the (looks-like-a-path) 
slash. Internally, we only use the dash version on compiler options to 
avoid this kind of issues.

/Magnus
> But it failed with config.log:
>
>> configure:50131:
>> /cygdrive/c/progra~2/micros~1/2019/commun~1/vc/tools/msvc/1424~1.283/bin/hostx86/x64/cl
>>    /DYNAMICBASE:NO /link /FIXED    /FIXED conftest.c  >&5
>> Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28316 for x64
>> Copyright (C) Microsoft Corporation.  All rights reserved.
>>
>> cl : Command line error D8003 : missing source filename
>> configure:50135: $? = 2
>> configure:50173: result: no
>> configure: failed program was:
>> | /* confdefs.h */
>> | #define PACKAGE_NAME "OpenJDK"
>> | #define PACKAGE_TARNAME "openjdk"
>> | #define PACKAGE_VERSION "openjdk"
>> | #define PACKAGE_STRING "OpenJDK openjdk"
>> | #define PACKAGE_BUGREPORT "build-dev at openjdk.java.net"
>> | #define PACKAGE_URL "http://openjdk.java.net"
>> | /* end confdefs.h.  */
>> |
>> | int
>> | main ()
>> | {
>> |
>> |   ;
>> |   return 0;
>> | }
>>
> It looks like LDFLAGS should be after filename for cl.
> Is there any option for add LDFLAGS after the filename (instead of before)?
> Or is there a new flag?




More information about the build-dev mailing list