[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    [openjfx11] Review request for 8203294: [Linux] Link libgcc and libstdc++ statically to support gcc-
From:       Arunprasad Rajkumar <arunprasad.rajkumar () oracle ! com>
Date:       2018-05-22 5:40:13
Message-ID: 921D97D2-6FFF-4B61-9EC5-54005DB4DC59 () oracle ! com
[Download RAW message or body]

Hi,

Please review the following fix: 

http://cr.openjdk.java.net/~arajkumar/8203294/webrev 

Root cause: 
Currently C and C++ standard libraries are linked dynamically(except javafx.web), it \
may restrict the usage of javafx on old Linux distros when we upgrade to latest \
compiler(GCC 7.3?) 

Solution: 
Fix all javafx module dynamic library linking process to use '-static-libgcc \
-static-libstdc++' flags to force the static linking of standard libs. Additionally \
'-ffunction-sections -fdata-sections' GCC compiler flags[1] are used to reduce the \
library size due to static linking.

Testing: 
Used the following command to see the size difference of javafx libraries with and \
without static linking  ```` 
find build/modular-sdk/modules_libs/ -type f -name *.so -exec ls -lh {} \; -exec sh \
-c 'ls -lh $JAVA_HOME/lib/$(basename {})' \;  ```` 

Used the following command to verify the fix, 
```` 
find build/modular-sdk/modules_libs -name *.so -exec sh -c "readelf -d {} | egrep \
'libgcc|libstdc++' > /dev/null && echo {}" \;  ```` 

[1] https://gcc.gnu.org/onlinedocs/gnat_ugn/Compilation-options.html

Thanks,
Arun=


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic