On Tue, 28 Feb 2023 06:47:37 GMT, Jayathirth D V <j...@openjdk.org> wrote:
>> make/modules/java.desktop/lib/Awt2dLibraries.gmk line 130: >> >>> 128: BUILD_LIBAWT_debug_mem.c_CFLAGS := -w >>> 129: # This option improves performance of FillRect/FillOval in Java2D by >>> 15% for some gcc >>> 130: LIBAWT_CFLAGS += -fpic >> >> So .. acc. to the eval in JBS we can get rid of -fgcse-after-reload because >> it is implied by -O3 >> And Erik says -fPIC is implied by -fpic >> >> So how is -fpic different than -fPIC in a way that helps here ? >> So far as I can tell the -fpic are using just limits the size of the global >> offset table that -fPIC will generate. >> Since we had an unlimited offset table before, then -fpic won't change >> anything. >> So what's the explanation ? > > Thanks @prrace for your inputs. > I dont think -fPIC is implied by -fpic. @erikj79 please clarify. > > Difference between -fpic and -fPIC: > 1) With -fPIC we have unlimited storage capacity for global offset table and > with -fpic on some platforms we have limitation on this size. For aarch64 it > is 28k, but in case of x86 size of GOT is unlimited irrespective of -fPIC or > -fpic. This is already captured. > 2) Also it looks like if we use -fpic option instead of -fPIC we may generate > smaller/faster code as mentioned at > http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html. Looks like > in our case, 28k GOT size suffices and we are able to create smaller/faster > code for libawt in case of aarch64. This inturn looks to be related to usage > of -msmall-data or -mlarge-data flags. -fpic implies -msmall-data and -fPIC > implies -mlarge-data while generating code for shared libraries. -msmall-data > also talks about data being nearer and easily accessible compared to > -mlarge-data(https://man7.org/linux/man-pages/man1/gcc.1.html) > > Also i can make this change specific to aarch64 since we are seeing its > effect only on aarch64. I think you have read more about the differences between -fpic and -fPIC than I have, so nothing I can add here. Making this option only on aarch64 seems like a reasonable idea if that's where we see the effect. ------------- PR: https://git.openjdk.org/jdk/pull/12761