unneeded -DUSE_MMAP in JDK native libs builds
    David Holmes 
    david.holmes at oracle.com
       
    Fri Aug  3 00:55:58 UTC 2018
    
    
  
On 3/08/2018 3:44 AM, Magnus Ihse Bursie wrote:
> 
>> 2 aug. 2018 kl. 05:33 skrev Baesken, Matthias <matthias.baesken at sap.com>:
>>
>> Hello I noticed that   -DUSE_MMAP  is set for these  JDK native libs, but I cannot find it in the code   (for libzip it is different there the flag shows up in the code too ) :
> 
> I've always assumed that this was used to control the behavior in some imported header files. Have you verified that this is not the case?
It is only used in
./java.base/share/native/libzip/zip_util.c
./java.base/share/native/libzip/zip_util.h
and the header itself is only included in the .c file. So unless this 
source file is used for the other libraries (which I don't see) then we 
don't need -DUSE_MMAP when building them.
AFAIKS the use of this for BUILD_LIBDT_SOCKET and BUILD_LIBDT_SHMEM
dates back to the build-infra changes in JDK 8.
http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/9d3d01aca52c
But I can't see why it was introduced there.
In JDK 7 it's only applied to the zip library.
Cheers,
David
-----
> 
> /Magnus
> 
>>
>> Lib-jdk.jdi.gmk  :
>>
>> 32  $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SHMEM, \
>> ......
>> 35 CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP, \
>>
>>
>> Lib-jdk.jdwp.agent.gmk :
>>
>> 30 $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \
>> ......
>> 33 CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
>>
>>
>> Any objections  to remove those  2    -DUSE_MMAP    settings ?
>> If it is fine to remove I would prepare a  webrev .
>>
>> Thanks, Matthias
> 
    
    
More information about the build-dev
mailing list