From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yiming Zhang" Subject: Build shared library (.so) for Mini-OS Date: Mon, 8 Apr 2013 09:54:13 +0100 Message-ID: <000901ce3436$a5849150$f08db3f0$@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Language: zh-cn List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Dear all, I want to realize dynamic library linking/loading for Mini-OS. The first step is to build a shared libc library (.so) from newlib-1.16.0. To achieve this, I modified the stubdom/Makefile to: (i) build all obj files (libc_objs = *.o) with -fPIC option, and (ii) tried to do "gcc -shared -o libc.so $(libc_objs)" However, the 2nd step cannot work because "string/memcpy.o" and "machine/x86_64/memcpy.o" both have a memcpy() function. Is there any way to build a shared libc library (.so) from newlib? (and how this problem is addressed for standard glibc?) Thank you! Cheers, Yiming