Commit fa0b638f by Richard Earnshaw Committed by Richard Earnshaw

[arm] Allow explicit periods to be escaped in


The MULTILIB_REUSE mapping rules are built up using periods to
represent the placement of '=' signs in the command line syntax.  This
presents a problem if the option contains an explicit period because
that is translated unconditionally.  The result is that it is not
currently possible to write a reuse rule that would match the
ARMv8-M mainline architecture:

	-march=armv8-m.main

To fix this, this patch allows an explicit period to be escaped by writing
\. and by then preserving the period into the generated multilib header.

	* genmultilib (multilib_reuse): Allow an explicit period to be escaped
	with a backslash.  Remove the backslash after substituting unescaped
	periods.
	* doc/fragments.texi (MULTILIB_REUSE): Document it.

From-SVN: r249298
parent f0cd49c5
2017-06-16 Richard Earnshaw <rearnsha@arm.com> 2017-06-16 Richard Earnshaw <rearnsha@arm.com>
* genmultilib (multilib_reuse): Allow an explicit period to be escaped
with a backslash. Remove the backslash after substituting unescaped
periods.
* doc/fragments.texi (MULTILIB_REUSE): Document it.
2017-06-16 Richard Earnshaw <rearnsha@arm.com>
* config.gcc: (arm*-*-*): When building a-profile libraries, force * config.gcc: (arm*-*-*): When building a-profile libraries, force
the driver to pass through the default setting of -mfloat-abi. the driver to pass through the default setting of -mfloat-abi.
* common/config/arm/arm-common.c (arm_target_thumb_only): Return -marm * common/config/arm/arm-common.c (arm_target_thumb_only): Return -marm
......
...@@ -160,10 +160,12 @@ A reuse rule is comprised of two parts connected by equality sign. The left ...@@ -160,10 +160,12 @@ A reuse rule is comprised of two parts connected by equality sign. The left
part is the option set used to build multilib and the right part is the option part is the option set used to build multilib and the right part is the option
set that will reuse this multilib. Both parts should only use options set that will reuse this multilib. Both parts should only use options
specified in @code{MULTILIB_OPTIONS} and the equality signs found in options specified in @code{MULTILIB_OPTIONS} and the equality signs found in options
name should be replaced with periods. The order of options in the left part name should be replaced with periods. An explicit period in the rule can be
matters and should be same with those specified in @code{MULTILIB_REQUIRED} or escaped by preceding it with a backslash. The order of options in the left
aligned with the order in @code{MULTILIB_OPTIONS}. There is no such limitation part matters and should be same with those specified in
for options in the right part as we don't build multilib from them. @code{MULTILIB_REQUIRED} or aligned with the order in @code{MULTILIB_OPTIONS}.
There is no such limitation for options in the right part as we don't build
multilib from them.
@code{MULTILIB_REUSE} is different from @code{MULTILIB_MATCHES} in that it @code{MULTILIB_REUSE} is different from @code{MULTILIB_MATCHES} in that it
sets up relations between two option sets rather than two options. Here is an sets up relations between two option sets rather than two options. Here is an
......
...@@ -466,8 +466,8 @@ echo "static const char *const multilib_reuse_raw[] = {" ...@@ -466,8 +466,8 @@ echo "static const char *const multilib_reuse_raw[] = {"
for rrule in ${multilib_reuse}; do for rrule in ${multilib_reuse}; do
# The left part of the rule are the options we used to build multilib. # The left part of the rule are the options we used to build multilib.
# The right part of the rule are the options that can reuse this multilib. # The right part of the rule are the options that can reuse this multilib.
combo=`echo ${rrule} | sed -e 's/=.*$//' -e 's/\./=/g'` combo=`echo ${rrule} | sed -e 's/=.*$//' -e 's/\([^\\]\)\./\1=/g' -e 's/\\\././g'`
copts=`echo ${rrule} | sed -e 's/^.*=//' -e 's/\./=/g'` copts=`echo ${rrule} | sed -e 's/^.*=//' -e 's/\([^\\]\)\./\1=/g' -e 's/\\\././g'`
# The variable ${combinations} are the option combinations we will build # The variable ${combinations} are the option combinations we will build
# multilib from. If the combination in the left part of reuse rule isn't # multilib from. If the combination in the left part of reuse rule isn't
# in this variable, it means no multilib will be built for current reuse # in this variable, it means no multilib will be built for current reuse
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment