This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SH4 build failure - The return of `-lc'


Arnaud, All,

On Tuesday 10 August 2010 06:44:50 Arnaud Lacombe wrote:
> I've been playing with gcc 4.5.1 on sh4, and it failed the following way
> --- libgcc/config/sh/t-linux    2010-08-10 00:20:56.000000000 -0400
> +++ libgcc/config/sh/t-linux.new        2010-08-10 00:21:02.000000000 -0400
> @@ -15,7 +15,7 @@
>         -Wl,--version-script=@shlib_map_file@ \
>         -o @multilib_dir@/@shlib_base_name@.so.1.tmp @multilib_flags@ \
> -       @shlib_objs@ -lc && \
> +       @shlib_objs@ && \
>         rm -f @multilib_dir@/@shlib_base_name@.so && \
>         if [ -f @multilib_dir@/@shlib_base_name@.so.1 ]; then \

I seem to recall there's a similar /fix/ for some other versions as well...

> Then I noticed the libgcc's `-lc' removal hack in `scripts/cc/gcc.sh'.
> The fact is that `libgcc.mvars' does include the -lc, however, it
> should not be fixed, `libgcc/config/sh/t-linux' should be. The reason
> is that the latter file is made to "Override SHLIB_LINK and
> SHLIB_INSTALL to use linker script libgcc_s.so."[0]. Unfortunately,
> this file is directly sourced from libgcc' Makefile, so the only way
> to fix it, from a runtime point of view would be to:
> 
> % cd "${CT_BUILD_DIR}/build-cc-core-shared/${CT_TARGET}/libgcc/"
> % tmake_file=$(sed '/^tmake_file.*$(srcdir)/!d; s///' Makefile)
> % sed 's/-lc//'
> "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/libgcc/$t{make_file}" >
> overridden_tmake_file
> % sed 's,\(tmake_file.*=\).*,\1 '$(pwd)'/overridden_tmake_file,'
> Makefile > Makefile.new
> % mv Makefile.new Makefile
> % cd -
> 
> Which I personally find gross, but it's working. The other way is the
> patch, but upstream is unlikely to consider it... unless I dig this
> `-lc' issue, but that might be an occasion to "fix it" for all arch,
> not just sh.
> 
> comments ?

None so far, it's late here, and I'm not in a position to think clearly...
I'm just acknowledging the issue, and will look into it later.

That being said, I'd rather have the sources patched, rather than having
yet another kludge in the build script. Let see that when me mind clears...

Anyway, the analysis is far better than what I had done so far, so this
is a very good starting point. :-)

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 unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]