From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8340 Path: news.gmane.org!not-for-mail From: Christian Lamparter Newsgroups: gmane.linux.lib.musl.general Subject: Re: SuperH conflict of arch/sh/__set_thread_area vs thread/__set_thread_area Date: Thu, 20 Aug 2015 12:21:55 +0200 Message-ID: <4450715.CJV8mqCvIO@debian64> References: <5769061.FLTLqujSyv@debian64> <20150820030402.GT32742@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: ger.gmane.org 1440066142 5843 80.91.229.3 (20 Aug 2015 10:22:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Aug 2015 10:22:22 +0000 (UTC) Cc: Rich Felker , Bobby Bingham To: musl@lists.openwall.com Original-X-From: musl-return-8352-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 20 12:22:14 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZSMz7-0003Qu-TH for gllmg-musl@m.gmane.org; Thu, 20 Aug 2015 12:22:14 +0200 Original-Received: (qmail 11631 invoked by uid 550); 20 Aug 2015 10:22:10 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11608 invoked from network); 20 Aug 2015 10:22:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding:content-type; bh=qkoUA7kzLcQHr/Wtdl5ft8n7bR2IfPGHdu3NTUfL0t0=; b=QF1K8b5x2osLjfVgkvYR22XfljO4WOjHSY2fvsNKLrmd7ERVUFapApd5+hvb66MC7D d6fB/LqBFqZrb45O1aqtat8MIS6j7G90lvgWHoMhC/uXL4d5tKVSRy3oWfResWDfxALV dD5Xp/NmaCbDH+sINFC4DI1WNQ9Y3ciVsCRA/1IQhIOK5jExAhgcqq3bn0jy89ROSu2L 5Joj7sG+sEYrTUfnfDng+jFrhi2dfNA/d5bZfjMQOUfASyNiWVH/ocHzWrKcj/oWk9HQ ZW0tBhgDWJLfKHNF7QCdLJfefxoo9aH7OM0pnKTXHWXAf9vlYoCBSdn+hPSmdd0jeZtf Q4Mw== X-Received: by 10.181.13.241 with SMTP id fb17mr64702535wid.13.1440066118196; Thu, 20 Aug 2015 03:21:58 -0700 (PDT) User-Agent: KMail/4.14.2 (Linux/4.2.0-rc6-wl+; KDE/4.14.10; x86_64; ; ) In-Reply-To: <20150820030402.GT32742@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:8340 Archived-At: 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