This is my current multilib version support for migrating PowerPC servers from using IBM extended double as the long double type to IEEE 128-bit floating point.
I have built both little endian and big endian PowerPC toolchains without the options, and it works with no regressions. I have also built a PowerPC little endian multlib toolchain (with IBM extended double as the default) and it worked, once I remembered to add the --with-system-zlib option. All of the other patches have been broken out of this patch and submitted (and now comitteed -- thanks Segher), and this patch just adds the option multlib support for PowerPC little endian. I ran out of time to add the PowerPC big endian multilib support (as it has to merge with 64/32-bit multilibs, and it also can only be enabled if the compiler is compiled using --with-cpu with at least power7). Some changes from the last change based on comments I got: 1) The lib64 directory is the directory that holds the default libraries. If you configure the default to be IEEE 128-bit, then those libraries are put into lib64. As Bill Schmidt said in an internal meeting, that is required by the ABI. Other languages should work normally, assuming they don't use long double. If they do use long double and use other libraries than libc/libm, they may need to use an -L -rpath optiosn to point to the old libraries. I'm sure as we get into modifying GLIBC 2.28, we will discover new things. 2) If you configure the compiler so that IBM long double is the default, the IEEE libraries are in lib64/ieee128. If you configure the compiler so that IEEE is the default, the IBM extended double libraries are in lib64/ibm128. I assume if we do a big endian port, we would use lib/ieee128 and lib/ibm128. 3) Tulio says that he believes that the GLIBC libraries will be able to handle the switch with a single library. However, it is not clear to me that other libraries like libstdc++, boost, etc. would be easy to add the necessary support to change the interfaces based on the defines. This is why I think we need multilibs, at least for a transition period. 4) As before, you have to explicitly configure the long double format to enable the multilibs. Particularly with having to create a special version of the Advance Toolchain with the crt/lib files in the alternate directory and use --with-system-zlib, you really don't want to enable the multilibs by default. Can I check this into the trunk? As I post this, there are two previous patches that have not been ack'ed that are not needed to enable the multilibs, but will be needed as we start doing the transition. The patches are: 1) The patch to set .gnu_attribute #4 if you use a long double value but don't do any calls. 2) The patch to document the --with-long-double-format={ieee,ibm} option. It would be useful if I could configure the compiler to look in lib64, if it doesn't find the objects in lib64/ieee128 or lib64/ibm128. But perhaps it is safer if it doesn't, since some things may fall through the cracks. Note, I will be on vacation for the next 4 days, and I will return on Tuesday January 16th, 2018. I will not have access to mail for most of the time. 2018-01-12 Michael Meissner <meiss...@linux.vnet.ibm.com> * config.gcc (powerpc*-linux*-*): Add support for 64-bit little endian Linux systems to optionally enable multilibs for selecting the long double type if the user configured an explicit type. * config/rs6000/rs6000.h (TARGET_IEEEQUAD_MULTILIB): Indicate we have no long double multilibs if not defined. * config/rs6000/rs6000.c (rs6000_option_override_internal): Do not warn if the user used -mabi={ieee,ibm}longdouble and we built multilibs for long double. * config/rs6000/linux64.h (MULTILIB_DEFAULTS_IEEE): Define as the appropriate multilib option. (MULTILIB_DEFAULTS): Add MULTILIB_DEFAULTS_IEEE to the default multilib options. * config/rs6000/t-ldouble-linux64le-ibm: New configuration files for building long double multilibs. * config/rs6000/t-ldouble-linux64le-ieee: Likewise. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797