On 17.06.21 23:57, Sandra Loosemore wrote: > On 6/17/21 1:40 PM, Jakub Jelinek wrote: >> Could we introduce a different option which wouldn't imply enabling that >> target: >> -foffload-options==option I think that works – in particular, if we do not document all the legacy stuff but just how it should be used. That includes not mentioning that disable and default can be used in a list and that those can also take arguments. > I don't feel qualified to comment on the details of the behavior, but > separating the options and making them more orthogonal to one another > would certainly make things easier to document. :-) I fully concur. Probably not fully polished, but I have attached a version for discussion. > One other thing I'd like to see in the docs is how to ask GCC what > offload targets it is configured to support by default. This could be > put in a paragraph that also includes the language about how you need > to have the compilers for those offload targets installed too. "gcc -v 2>&1 |grep OFFLOAD_TARGET_NAMES" shows them. Note that with the flags under discussion, you can modify the output, e.g. * "gcc -v -foffload=disable" removes it * "gcc -v -foffload=nvptx-none" either gives an error (not supported) or just shows that single target. * * * Installing: Building oneself: "make install" – and everything is there With a distributions, you need to find the name of the .rpm/.deb package for the target your are interested in and then run apt-get / yum / zypper / ... Hence, when you normally build GCC as a user, for all configured offload targets, their lto1 should be there - and if lto-wrapper cannot find it, it aborts with a fatal error. For distribution compilers, it usually just means that the optional package is not installed – the missing lto1 should/is then just ignored, That's the reason why GCC's configure script now has a flag --enable-offload-defaulted to toggle between supporting optional packages (distro use) and always errors (normal use). If you want to know how to build it, have a lot of fun with incomplete documentation and a look at https://gcc.gnu.org/wiki/Offloading or at the SUSE/Debian/Red Hat build scripts or g-t-s – and expect that you won't finish soon ... Tobias ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf