Message ID | 38226b76-e1bf-7ddc-7f2b-13f7d7b6a440@foss.arm.com |
---|---|
State | New |
Headers | show |
On 08/10/2016 09:51 AM, Thomas Preudhomme wrote: > > > *** gcc/ChangeLog *** > > 2016-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com> > > * doc/fragments.texi (MULTILIB_REUSE): Mention that only options in > MULTILIB_OPTIONS should be used. Small wording fixes. > * genmultilib: Memorize set of all option combinations in > combination_space. Detect if RHS of MULTILIB_REUSE uses an > option not > found in MULTILIB_OPTIONS by checking if option set is listed in > combination_space. Output new and existing error message to > stderr. [ snip ] > +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 > +set that will reuse this multilib. Both part should only use options specified "Both part" -> "Both parts" I think here. OK with that change. jeff
On 18/08/16 17:39, Jeff Law wrote: > On 08/10/2016 09:51 AM, Thomas Preudhomme wrote: >> >> >> *** gcc/ChangeLog *** >> >> 2016-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com> >> >> * doc/fragments.texi (MULTILIB_REUSE): Mention that only options in >> MULTILIB_OPTIONS should be used. Small wording fixes. >> * genmultilib: Memorize set of all option combinations in >> combination_space. Detect if RHS of MULTILIB_REUSE uses an >> option not >> found in MULTILIB_OPTIONS by checking if option set is listed in >> combination_space. Output new and existing error message to >> stderr. > [ snip ] > > >> +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 >> +set that will reuse this multilib. Both part should only use options specified > "Both part" -> "Both parts" I think here. > > OK with that change. Noted. I'm waiting for https://gcc.gnu.org/ml/gcc-patches/2016-08/msg00814.html before committing this or otherwise build using --with-multilib-list=aprofile would stop working. Best regards, Thomas
On 18/08/16 17:39, Jeff Law wrote: > On 08/10/2016 09:51 AM, Thomas Preudhomme wrote: >> >> >> *** gcc/ChangeLog *** >> >> 2016-08-01 Thomas Preud'homme <thomas.preudhomme@arm.com> >> >> * doc/fragments.texi (MULTILIB_REUSE): Mention that only options in >> MULTILIB_OPTIONS should be used. Small wording fixes. >> * genmultilib: Memorize set of all option combinations in >> combination_space. Detect if RHS of MULTILIB_REUSE uses an >> option not >> found in MULTILIB_OPTIONS by checking if option set is listed in >> combination_space. Output new and existing error message to >> stderr. > [ snip ] > > >> +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 >> +set that will reuse this multilib. Both part should only use options specified > "Both part" -> "Both parts" I think here. > > OK with that change. Committed with the change, thanks. Best regards, Thomas
diff --git a/gcc/doc/fragments.texi b/gcc/doc/fragments.texi index f4e6636fb9510c0da40f1956c1f40f8bc0e23510..b6d8541c8ca820fa732363a05221e2cd4d1251c2 100644 --- a/gcc/doc/fragments.texi +++ b/gcc/doc/fragments.texi @@ -156,15 +156,16 @@ variants. And for some targets it is better to reuse an existing multilib than to fall back to default multilib when there is no corresponding multilib. This can be done by adding reuse rules to @code{MULTILIB_REUSE}. -A reuse rule is comprised of two parts connected by equality sign. The left part -is option set used to build multilib and the right part is option set that will -reuse this multilib. The order of options in the left part matters and should be -same with those specified in @code{MULTILIB_REQUIRED} or aligned with order in -@code{MULTILIB_OPTIONS}. There is no such limitation for options in right part -as we don't build multilib from them. But the equality sign in both parts should -be replaced with period. - -The @code{MULTILIB_REUSE} is different from @code{MULTILIB_MATCHES} in that it +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 +set that will reuse this multilib. Both part should only use 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 matters and +should be same with those specified in @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 sets up relations between two option sets rather than two options. Here is an example to demo how we reuse libraries built in Thumb mode for applications built in ARM mode: diff --git a/gcc/genmultilib b/gcc/genmultilib index 083259aa82ca085be7410faa92929eb429393f92..eb5f661a5fded65a44a725884f77bf2e46f3ab1a 100644 --- a/gcc/genmultilib +++ b/gcc/genmultilib @@ -186,7 +186,8 @@ fi EOF chmod +x tmpmultilib -combinations=`initial=/ ./tmpmultilib ${options}` +combination_space=`initial=/ ./tmpmultilib ${options}` +combinations="$combination_space" # If there exceptions, weed them out now if [ -n "${exceptions}" ]; then @@ -472,14 +473,19 @@ for rrule in ${multilib_reuse}; do # in this variable, it means no multilib will be built for current reuse # rule. Thus the reuse purpose specified by current rule is meaningless. if expr "${combinations} " : ".*/${combo}/.*" > /dev/null; then - combo="/${combo}/" - dirout=`./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"` - copts="/${copts}/" - optout=`./tmpmultilib4 "${copts}" "${options}"` - # Output the line with all appropriate matches. - dirout="${dirout}" optout="${optout}" ./tmpmultilib2 + if expr "${combination_space} " : ".*/${copts}/.*" > /dev/null; then + combo="/${combo}/" + dirout=`./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"` + copts="/${copts}/" + optout=`./tmpmultilib4 "${copts}" "${options}"` + # Output the line with all appropriate matches. + dirout="${dirout}" optout="${optout}" ./tmpmultilib2 + else + echo "The rule ${rrule} contains an option absent from MULTILIB_OPTIONS." >&2 + exit 1 + fi else - echo "The rule ${rrule} is trying to reuse nonexistent multilib." + echo "The rule ${rrule} is trying to reuse nonexistent multilib." >&2 exit 1 fi done