[PATCH 4 of 7] cc/gcc: Add support for getting a gcc snapshot

Bryan Hundven bryanhundven@gmail.com
Fri Dec 10 18:41:00 GMT 2010


On Fri, Dec 10, 2010 at 10:03 AM, Yann E. MORIN
<yann.morin.1998@anciens.enib.fr> wrote:
> Bryan, All,
>
> On Friday 10 December 2010 00:47:13 Bryan Hundven wrote:
>> >> On Thu, Dec 9, 2010 at 2:06 PM, Yann E. MORIN
>> >> <yann.morin.1998@anciens.enib.fr> wrote:
>> >>> On Tuesday 07 December 2010 10:06:57 Bryan Hundven wrote:
> [--SNIP--]
>> >>>> diff -r 73795525c82e -r 8f7cc140fe23 scripts/crosstool-NG.sh.in
>> >>>> --- a/scripts/crosstool-NG.sh.in      Mon Dec 06 22:42:07 2010 -0800
>> >>>> +++ b/scripts/crosstool-NG.sh.in      Tue Dec 07 00:56:34 2010 -0800
>> >>>> @@ -151,6 +151,16 @@
>> >>>>  CT_CC_CORE_EXTRA_CONFIG="${CT_ARCH_CC_CORE_EXTRA_CONFIG} ${CT_CC_CORE_EXTRA_CONFIG}"
>> >>>>  CT_CC_EXTRA_CONFIG="${CT_ARCH_CC_EXTRA_CONFIG} ${CT_CC_EXTRA_CONFIG}"
>> >>>>
>> >>>> +# If we are using a gcc snapshot, get the real "version number" straight
>> >>>> +# here so we don't have to modify the build scripts.
>> >>>> +if [ "${CT_CC_V_4_5_SNAPSHOT}" = "y" -o "${CT_CC_V_4_6_SNAPSHOT}" = "y" ]; then
>> >>>> +    if [ -n "${CT_CC_SNAPSHOT}" ]; then
>> >>>> +        CT_CC_VERSION="${CT_CC_VERSION}${CT_CC_SNAPSHOT}"
>> >>>> +    else
>> >>>> +        CT_Abort "You forgot to set the gcc snapshot date!"
>> >>>> +    fi
>> >>>> +fi
>> >>>
>> >>> This should go to the gcc.sh script. I know you needed it to be globally
>> >>> available for the strip phase above, but that will no longer be needed.
>> >>
>> >> ack.
>> >
>> > Actually, come to think about it, when you use the snapshot, the
>> > ${CT_CC_VERSION} - which for a snapshot would be something like:
>> > 4.6-20101204 - would not be what gcc-${CT_CC_VERSION} is.
>> >
>> > Say I used said snapshot, gcc-${CT_CC_VERSION} would be 4.6.0, because
>> > that is what is in ${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER
> [--SNIP--]
>> >>>> +# When referencing the real gcc version, and not the (possibly) snapshot
>> >>>> +# version, use ${CT_CC_REAL_VERSION} instead of the (possibly) snapshot
>> >>>> +# version.
>> >>>> +CT_CC_REAL_VERSION=$(cat ${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER)
>> >>>> +
>> >>>>  # Now for the job by itself. Go have a coffee!
>> >>>>  if [ "${CT_ONLY_DOWNLOAD}" != "y" -a "${CT_ONLY_EXTRACT}" != "y" ]; then
>> >>>>      # Because of CT_RESTART, this becomes quite complex
>
>> And after _actually_ looking at the change you made to internals.sh,
>> these are the two that would need ${CT_CC_REAL_VERSION}:
>> "libexec/gcc/${CT_TARGET}/${CT_CC_VERSION}/"*                 \
>> "libexec/gcc/${CT_TARGET}/${CT_CC_VERSION}/install-tools/"*   \
>
> Yes, for now. But I would like to get rid of it. The fact is that will break
> if/when we add another compiler (eg. I think about Clang), and CT_CC_VERSION
> would not be set in that case.
>
> So, we have a few possibilities:
> - use wildcards, such as: libexec/gcc/${CT_TARGET}/*/* but that would break
>  as well, because it still has 'gcc' in it.
> - ask the compiler its name and version, a bit like we have for the C
>  library, eg. ${CT_LIBC} contains the libc name (uClibc, eglibc...), we
>  could have CT_CC contain the compiler name. Also, like we do for newlib,
>  have a function that computes and echoes the complete version string,
>  eg. use something like: cc_ver="$(cc_${CT_CC}_version)"
>  But that may still be broken, if another compiler installs things in
>  other places. That's moot for now, however, and we can live with that
>  known layout for now...
> - expect each and every components to install-strip. This is not really
>  possible for some/most of them, and not very convenient as all of them
>  would have to do conditional install, and this would make the scripts
>  (a little more) ugly.
>
> Well, I'd vote for #1 above, until we have a reason to do better. What about
> you?
>
> Regards,
> Yann E. MORIN.
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
>

for _path in "LIST OF PATHS"; do
for _file in $(find ${_path} -type f | xargs file | grep 'not
stripped' | cut -d: -f1); do ${CT_TARGET}-strip ${_file}; done
done

-Bryan

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list