Dominique Martinet wrote on Tue, Aug 04, 2020:
> So I'd really need a way to have only that file compiled with the
> optimisations, and other files without it -- Jeff or someone else, could
> you please advise?

I could still use help with that, please.

To recap, waypipe:
 - compiles a single function in single .c file into a static lib (.a)
with optimisations e.g. `-mavx512f -mlzcnt -mbmi` or `-mfpu=neon`
depending on what the compiler provides.
 - compiles other stuff without these optimisations; the other stuff
knows what has been compiled or not through #ifdefs.
 - link the other stuff with that aforementioned .a
( - at runtime, decides if it is safe or not to run the optimized
function, and only runs it if the hardware supports it -- since the code
that makes the decision is compiled without the optimizations the binary
as a whole should run on whatever we support)


with -flto=auto, the final link step fails with the following:

https://kojipkgs.fedoraproject.org//work/tasks/2576/48362576/build.log
------
gcc  -o test/diff_roundtrip test/diff_roundtrip.p/diff_roundtrip.c.o 
-Wl,--as-needed -Wl,--no-undefined -O2 -flto=auto -ffat-lto-objects 
-fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=armv7-a -mfpu=vfpv3-d16 
-mtune=generic-armv7-a -mabi=aapcs-linux -mfloat-abi=hard -Wl,-z,relro 
-Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld 
-Wl,--start-group src/libwaypipe_src.a src/libkernel_neon.a 
protocols/libprotocols.a -pthread -lrt /usr/lib/libgbm.so /usr/lib/liblz4.so 
/usr/lib/libzstd.so -Wl,--end-group 
'-Wl,-rpath,$ORIGIN/../src:$ORIGIN/../protocols' 
-Wl,-rpath-link,/builddir/build/BUILD/waypipe-v0.6.1/armv7hl-redhat-linux-gnueabi/src
 
-Wl,-rpath-link,/builddir/build/BUILD/waypipe-v0.6.1/armv7hl-redhat-linux-gnueabi/protocols
/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/10/include/arm_neon.h: In function 
‘run_interval_diff_neon’:
/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/10/include/arm_neon.h:10426:22: fatal 
error: You must enable NEON instructions
(e.g. ‘-mfloat-abi=softfp’ ‘-mfpu=neon’) to use these intrinsics.
10426 |   return (uint64x2_t)__builtin_neon_vld1v2di ((const __builtin_neon_di 
*) __a);
      |                      ^
compilation terminated.
------

where `run_interval_diff_neon`is the optimised function that was
compiled in the first .a with optimization flags




From what I have read it's not possible to mark a function or a file as
"LTO disabled"? Did I get that correctly?
What can I or upstream do about this? I mean, I can disable LTO in the
spec file but what _should_ I do ;)

Is it a bug I should file a gcc bz for or is that a feature I don't
understand?
FWIW I don't have the problem with avx512f, it links just fine.


Thanks,
-- 
Dominique
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to