Query re software caching example
Posted: Thu Apr 23, 2015 9:13 pm
I've been taking a look at the software caching example which is included in the Jan 30th 2015 headless Ubuntu image. I'm a bit confused by how it is being built.
My starting point was the description here - https://github.com/adapteva/epiphany-sd ... re-caching. But the Makefile in the example contradicts this description - There is no use of the -fsoftware-cache flag, instead there is -fpic. (I wondered if there had been a change since the 2014.11 release, but the Github history of the example indicates it's always been like this -
https://github.com/embecosm/parallella- ... h/Makefile)
It makes sense to me that the code to be cached needs to be position independent, and hence that the -fpie flag needed to be implemented as part of the software caching release, but wouldn't it be the target code (not the calling code) that needs this flag to be applied to its compilation (in this case, the math functions in the standard library)?
What is happening in the compilation of the calling code? Does -fpie imply -fsoftware-cache too? (If so, wouldn't there be instances where you want position independent code without software caching of any function calls made by that code?) And why does the main module of the caching example need to be position independent?
I may be misunderstanding something fundamental, but hopefully the above questions make some sort of sense.
[Edit: Ah, is the -fpie flag for the linker? (So it's all or nothing, with regard to whether you have position independent code or not?) If that's the case, then I suppose the only question is where the -fsoftware-cache option is hiding.]
My starting point was the description here - https://github.com/adapteva/epiphany-sd ... re-caching. But the Makefile in the example contradicts this description - There is no use of the -fsoftware-cache flag, instead there is -fpic. (I wondered if there had been a change since the 2014.11 release, but the Github history of the example indicates it's always been like this -
https://github.com/embecosm/parallella- ... h/Makefile)
It makes sense to me that the code to be cached needs to be position independent, and hence that the -fpie flag needed to be implemented as part of the software caching release, but wouldn't it be the target code (not the calling code) that needs this flag to be applied to its compilation (in this case, the math functions in the standard library)?
What is happening in the compilation of the calling code? Does -fpie imply -fsoftware-cache too? (If so, wouldn't there be instances where you want position independent code without software caching of any function calls made by that code?) And why does the main module of the caching example need to be position independent?
I may be misunderstanding something fundamental, but hopefully the above questions make some sort of sense.
[Edit: Ah, is the -fpie flag for the linker? (So it's all or nothing, with regard to whether you have position independent code or not?) If that's the case, then I suppose the only question is where the -fsoftware-cache option is hiding.]