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

Bryan Hundven bryanhundven@gmail.com
Thu Dec 9 23:47:00 GMT 2010


On Thu, Dec 9, 2010 at 3:35 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
> On Thu, Dec 9, 2010 at 2:56 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
>> On Thu, Dec 9, 2010 at 2:06 PM, Yann E. MORIN
>> <yann.morin.1998@anciens.enib.fr> wrote:
>>> Bryan, All,
>>>
>>> On Tuesday 07 December 2010 10:06:57 Bryan Hundven wrote:
>>>> # HG changeset patch
>>>> # User Bryan Hundven <bryanhundven@gmail.com>
>>>> # Date 1291712194 28800
>>>> # Node ID 8f7cc140fe23d204d2d1915fb3f496f4eef9a7c6
>>>> # Parent  73795525c82eaa7f4561f358c70d26ef9d72a446
>>>> cc/gcc: Add support for getting a gcc snapshot
>>>>
>>>> diff -r 73795525c82e -r 8f7cc140fe23 config/cc.in
>>>> --- a/config/cc.in    Mon Dec 06 22:42:07 2010 -0800
>>>> +++ b/config/cc.in    Tue Dec 07 00:56:34 2010 -0800
>>>> @@ -8,6 +8,9 @@
>>>>  config CC_VERSION
>>>>      string
>>>>
>>>> +config CC_SNAPSHOT
>>>> +    string
>>>> +
>>>>  source "config.gen/cc.in"
>>>>
>>>>  config CC_SUPPORT_CXX
>>>> diff -r 73795525c82e -r 8f7cc140fe23 config/cc/gcc.in
>>>> --- a/config/cc/gcc.in        Mon Dec 06 22:42:07 2010 -0800
>>>> +++ b/config/cc/gcc.in        Tue Dec 07 00:56:34 2010 -0800
>>>> @@ -19,6 +19,30 @@
>>>>  # Don't remove next line
>>>>  # CT_INSERT_VERSION_BELOW
>>>>
>>>> +config CC_V_4_6_SNAPSHOT
>>>> +    bool
>>>> +    prompt "4.6 Snapshot (EXPERIMENTAL)"
>>>> +    depends on EXPERIMENTAL
>>>> +    select CC_GCC_4_6_or_later
>>>> +
>>>> +config CC_V_4_5_SNAPSHOT
>>>> +    bool
>>>> +    prompt "4.5 Snapshot (EXPERIMENTAL)"
>>>> +    depends on EXPERIMENTAL
>>>> +    select CC_GCC_4_5_or_later
>>>> +
>>>> +config CC_V_4_4_SNAPSHOT
>>>> +    bool
>>>> +    prompt "4.4 Snapshot (EXPERIMENTAL)"
>>>> +    depends on EXPERIMENTAL
>>>> +    select CC_GCC_4_4_or_later
>>>> +
>>>> +config CC_V_4_3_SNAPSHOT
>>>> +    bool
>>>> +    prompt "4.3 Snapshot (EXPERIMENTAL)"
>>>> +    depends on EXPERIMENTAL
>>>> +    select CC_GCC_4_3_or_later
>>>> +
>>>
>>> I'd rather have the 4.x snapshots be beside the corresponding 4.x.y
>>> stable versions, eg:
>>>  4.6-snapshot
>>>  4.5-snapshot
>>>  4.5.1
>>>  4.5.0
>>>  4.4-snapshot
>>>  4.4.5
>>>  4.4.4
>>>  ...
>>>  4.3-snapshot
>>>  4.3.5
>>>  ...
>>
>> Sure! Makes sense to me. I think Arnaud's version of the patch did the same.
>>
>>>>  config CC_V_4_5_1
>>>>      bool
>>>>      prompt "4.5.1 (EXPERIMENTAL)"
>>>> @@ -154,6 +178,11 @@
>>>>      select CC_GCC_USE_MPC
>>>>      select CC_GCC_HAS_LTO
>>>>
>>>> +config CC_GCC_4_6_or_later
>>>> +    bool
>>>> +    default n
>>>> +    select CC_GCC_4_5_or_later
>>>> +
>>>>  config CC_GCC_HAS_GRAPHITE
>>>>      bool
>>>>      default n
>>>> @@ -188,6 +217,10 @@
>>>>      string
>>>>  # Don't remove next line
>>>>  # CT_INSERT_VERSION_STRING_BELOW
>>>> +    default "4.6-" if CC_V_4_6_SNAPSHOT
>>>> +    default "4.5-" if CC_V_4_5_SNAPSHOT
>>>> +    default "4.4-" if CC_V_4_4_SNAPSHOT
>>>> +    default "4.3-" if CC_V_4_3_SNAPSHOT
>>>>      default "4.5.1" if CC_V_4_5_1
>>>>      default "4.5.0" if CC_V_4_5_0
>>>>      default "4.4.5" if CC_V_4_4_5
>>>
>>> Ditto.
>>
>> ack.
>>
>>>> @@ -217,6 +250,15 @@
>>>>      depends on CC_LANG_JAVA
>>>>      depends on CC_GCC_4_3_or_later
>>>>
>>>> +config CC_SNAPSHOT
>>>> +    string
>>>> +    prompt "gcc snapshot date"
>>>> +    depends on CC_V_4_6_SNAPSHOT || CC_V_4_5_SNAPSHOT || CC_V_4_4_SNAPSHOT || CC_V_4_3_SNAPSHOT
>>>> +    default ""
>>>> +    help
>>>> +     Check ftp://gcc.gnu.org/pub/gcc/snapshots/ for the latest snapshot.
>>>> +     The string to enter should be just the 'YYYYMMDD' date of the snapshot.
>>>> +
>>>
>>> How long are the snapshots kept on there? It looks like only for about
>>> 6-8 months. Which means that starting again with the same .config would
>>> make the toolchain no longer buildable after that period of time has
>>> elapsed.
>>>
>>> This should probably not be an issue, as using a toolchain based on a
>>> snapshot for production would be highly dubious. But once the option
>>> is here, people will start using it, forget about it, and ship their
>>> snapshot-toolchain to the outter world. Which means they'll be screwed
>>> if they have to fix it later.
>>>
>>> So, I would like you add a BIG FAT WARNING roughly saying:
>>>
>>>  BIG FAT WARNING ! You are using a snapshot, there is no guarantee that
>>>  the toolchain will properly work, or even build. You might even not be
>>>  able to reproduce it later, if the upstream snapshot eventually disapears
>>>  (and they have a tendency to disapear after a not-so-long period).
>>>
>>>  So, it is HIGHLY advised:
>>>  - that you think twice before you keep using a snapshot, and if so:
>>>  - that you save the snapshot tarball by your own means in a safe place.
>>>
>>> Roughly that. I leave it to you to rephrase it, if you want. :-)
>>
>> I totally agree.
>> Maybe besides having EXPERIMENTAL, we should have SNAPSHOT or DEVELOPER.
>> And these options would have the "BIG FAT WARNING". What do you think?
>>
>>>>  config CC_PKGVERSION
>>>>      string
>>>>      prompt "gcc ID string"
>>>> diff -r 73795525c82e -r 8f7cc140fe23 scripts/build/internals.sh
>>>> --- a/scripts/build/internals.sh      Mon Dec 06 22:42:07 2010 -0800
>>>> +++ b/scripts/build/internals.sh      Tue Dec 07 00:56:34 2010 -0800
>>>> @@ -20,12 +20,12 @@
>>>>          esac
>>>>          CT_DoLog INFO "Stripping all toolchain executables"
>>>>          CT_Pushd "${CT_PREFIX_DIR}"
>>>> -        for t in ar as c++ c++filt cpp dlltool dllwrap g++ gcc gcc-${CT_CC_VERSION} gcov gprof ld nm objcopy objdump ranlib readelf size strings strip addr2line windmc windres; do
>>>> +        for t in ar as c++ c++filt cpp dlltool dllwrap g++ gcc gcc-${CT_CC_REAL_VERSION} gcov gprof ld nm objcopy objdump ranlib readelf size strings strip addr2line windmc windres; do
>>>>              [ -x bin/${CT_TARGET}-${t}${CT_HOST_SUFFIX} ] && ${CT_HOST}-strip ${strip_args} bin/${CT_TARGET}-${t}${CT_HOST_SUFFIX}
>>>>              [ -x ${CT_TARGET}/bin/${t}${CT_HOST_SUFFIX} ] && ${CT_HOST}-strip ${strip_args} ${CT_TARGET}/bin/${t}${CT_HOST_SUFFIX}
>>>>          done
>>>>          CT_Popd
>>>> -        CT_Pushd "${CT_PREFIX_DIR}/libexec/gcc/${CT_TARGET}/${CT_CC_VERSION}"
>>>> +        CT_Pushd "${CT_PREFIX_DIR}/libexec/gcc/${CT_TARGET}/${CT_CC_REAL_VERSION}"
>>>>          for t in cc1 cc1plus collect2; do
>>>>              [ -x ${t}${CT_HOST_SUFFIX} ] && ${CT_HOST}-strip ${strip_args} ${t}${CT_HOST_SUFFIX}
>>>>          done
>>>
>>> This will no longer apply, I've reworked that stuff in my tree, as some
>>> stuff was missing in there. I'll push that a bit later in the week, sorry
>>> for that... :-/
>>
>> Go, go gadget mq. I'll "hg qpop -a && hg pull -u", fix the other
>> problems, and re-post.
>>
>>>> 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
>
>>>>  # Compute the working directories names
>>>>  CT_TARBALLS_DIR="${CT_WORK_DIR}/tarballs"
>>>>  CT_SRC_DIR="${CT_WORK_DIR}/src"
>>>> @@ -572,6 +582,11 @@
>>>>      fi
>>>>  fi
>>>>
>>>> +# 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
>>>
>>> Ditto.
>>
>> ack.
>
> ... and because of that, I will still need this CT_CC_REAL_VERSION.
>
> and set gcc-${CT_CC_REAL_VERSION} in internals.sh.

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/"*   \


>>> 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.  |
>>> '------------------------------^-------^------------------^--------------------'
>>>
>>>
>>>
>>
>>
>> -Bryan
>>
>
> -Bryan
>

-Bryan

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



More information about the crossgcc mailing list