mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Christian Lamparter <chunkeey@googlemail.com>
To: musl@lists.openwall.com
Cc: Rich Felker <dalias@libc.org>, Bobby Bingham <koorogi@koorogi.info>
Subject: Re: SuperH conflict of arch/sh/__set_thread_area vs thread/__set_thread_area
Date: Thu, 20 Aug 2015 12:21:55 +0200	[thread overview]
Message-ID: <4450715.CJV8mqCvIO@debian64> (raw)
In-Reply-To: <20150820030402.GT32742@brightrain.aerifal.cx>

On Wednesday, August 19, 2015 11:04:02 PM Rich Felker wrote:
> On Thu, Aug 20, 2015 at 02:44:11AM +0200, Christian Lamparter wrote:
> > Hello,
> > 
> > I'm trying to add a port for a SH4-like ARCH to OpenWRT, which uses the latest
> > musl-1.1.10 as the default libc. I'm having the following problem when building
> > the toolchain:
> > 
> > During the final linker-step, the symbol "__set_thread_area"  declared twice.
> > This is because the SH architecture provides a separate __set_thread_area [0],
> > (other archs use the standard syscall wrapper from [1]).
> > 
> > Obviously, I want this issue fixed. However I'm new to SuperH and musl, that's
> > why I need advise :-D. For now, I defined the src/thread/__set_thread_area as
> > a weak symbol. Now, that's just a crude hack, what would be better solution?
> > (I can make and post the patch if necessary - But sadly, I can't test it on the
> > hardware yet)?
> 
> Bobby Bingham's reply explains what the issue is. Did you make a new
> arch name rather than using the existing sh arch for your port? 
Initially, yes I did. I had the ARCH at "sh4". This was because OpenWRT 
already had infrastructure for some sh-(sub)targets (sh3, sh3eb, sh4, sh4eb)
in place. But they seem to be unused and untested. The only target which has
support for SuperH is UserModeLinux. However, it will probably run into the
same issue.

Now, I've changed ARCH to "sh" and set the CPU_TYPE to sh4 [toolchain
dir changed to toolchain-sh_sh4_gcc-5.2.0_musl-1.1.10]. But still no 
luck, the original error code remains the same.

src/thread/__set_thread_area.lo: In function `__set_thread_area':
__set_thread_area.c:(.text+0x0): multiple definition of `__set_thread_area'
arch/sh/src/__set_thread_area.lo:__set_thread_area.c:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
Makefile:142: recipe for target 'lib/libc.so' failed

> If it's ABI-compatible, it would probably make more sense to use the
> existing one and extend it to support your hardware.
In case you want to know: Hardware is a 2013 Sat>IP set-top-box
(idl4k platform) with a STx7108 (that's sh4, little endian, 
with mmu and with fpu).

> I'm working on an sh-related project right now 
> (see http://0pf.org/j-core.html) and one of my goals is to get sh
> more unified as a platform where it's possible to have binaries
> for the baseline ISA that work on lots of different hardware models
> (including nommu ones).
The J4 arch is sadly 2 years ahead of time ;-) [EU4]. But I think
I'll definitely need some help to figure out - Another issue seems
to be that the arch string changed from sh*-linux to sh-*-linux
between gcc-4.8 and gcc-5.2... So, what to do?

Regards,
Christian


  reply	other threads:[~2015-08-20 10:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20  0:44 Christian Lamparter
2015-08-20  1:03 ` curious file access problem Sebastian Gottschall
2015-08-20  2:56   ` Rich Felker
2015-08-20  6:48   ` Bastian Bittorf
2015-08-20 10:55     ` Sebastian Gottschall
2015-08-20 13:25       ` Bastian Bittorf
2015-08-20 13:48         ` Rich Felker
2015-08-20 14:26           ` Bastian Bittorf
2015-08-20 14:32             ` Rich Felker
2015-08-20 14:51           ` Sebastian Gottschall
2015-08-20 15:00             ` Rich Felker
2015-08-20 18:30               ` Timo Teras
2015-08-20 21:03                 ` Sebastian Gottschall
2015-08-20 21:46                 ` Sebastian Gottschall
2015-08-20 14:14   ` Bastian Bittorf
2015-08-20  1:34 ` SuperH conflict of arch/sh/__set_thread_area vs thread/__set_thread_area Bobby Bingham
2015-08-20  3:04 ` Rich Felker
2015-08-20 10:21   ` Christian Lamparter [this message]
2015-08-21 14:07     ` Christian Lamparter
2015-08-21 14:23       ` Rich Felker
2015-08-25  7:48         ` Felix Fietkau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4450715.CJV8mqCvIO@debian64 \
    --to=chunkeey@googlemail.com \
    --cc=dalias@libc.org \
    --cc=koorogi@koorogi.info \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).