You are not logged in.

#1 2013-02-26 16:11:19

dlin
Member
From: Taipei,Taiwan
Registered: 2005-09-21
Posts: 264

Trying build debian's apt on sh4, but runtime error

Is there any tip to help find out this core dump root reason?
The aur's PKGBUILD and My PKGBUILD.1 diff as

 $ diff -u PKGBUILD PKGBUILD.1
--- PKGBUILD    2013-02-19 00:04:56.000000000 +0800
+++ PKGBUILD.1  2013-02-26 22:48:49.000000000 +0800
@@ -3,7 +3,7 @@
 pkgver=0.9.7.7
 pkgrel=3
 pkgdesc="commandline package manager"
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' sh4)
 url="http://packages.debian.org/sid/apt"
 license=('GPL2')
 url="http://packages.debian.org/sid/apt"
 license=('GPL2')
 depends=('gnupg' 'curl')
@@ -14,7 +14,7 @@
 conflicts=()
 replaces=()
 backup=()
-options=()
+options=(!strip)
 install=
 changelog=
 source=(http://ftp.debian.org/debian/pool/main/a/$pkgname/${pkgname}_$pkgver.tar.gz)
@@ -30,7 +30,7 @@
   # disable debiandoc, this saves us from sgml problems
   sed -i -e 's|-C doc $@|-C doc manpages|' Makefile
   ./configure --prefix=/usr
-  make
+  make CFLAGS=-g LDFLAGS=-shared
 }
 
 check() {
$ gdb pkg/usr/bin/apt-get                     
GNU gdb (GDB) STMicroelectronics/Linux Base 7.1.50.20100224-25 [build Mar 22 2010]
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "sh4-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dlin/abs/local/apt/pkg/usr/bin/apt-get...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/dlin/abs/local/apt/pkg/usr/bin/apt-get 

Program received signal SIGSEGV, Segmentation fault.
0x52ac2cb6 in __do_global_dtors_aux ()
(gdb) bt
#0  0x52ac2cb6 in __do_global_dtors_aux ()
(gdb) 

Running 4 ArchLinux including sh4twbox,server,notebook,desktop. my AUR packages, old project Arch on colinux,

Offline

#2 2013-02-27 01:46:00

dlin
Member
From: Taipei,Taiwan
Registered: 2005-09-21
Posts: 264

Re: Trying build debian's apt on sh4, but runtime error

I try to google http://www.cplusplus.com/forum/unices/61996/.

I guess the problem may caused by I add a '-shared' option to linker.
But, if I don't add such option, the linker will show another strange message. (I'm using STLinux's gcc instead of Arch Linux's gcc as basement).

Building program /home/dlin/abs/local/apt/src/apt-0.9.7.7/bin/methods/file
/usr/bin/ld: /home/dlin/abs/local/apt/src/apt-0.9.7.7/bin/methods/file: hidden symbol `__movmem_i4_odd' in /usr/lib/gcc/sh4-linux/4.2.4/libgcc.a(_movmem_i4.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[2]: *** [/home/dlin/abs/local/apt/src/apt-0.9.7.7/bin/methods/file] Error 1

if I change the '-shared' to '-nostdlib'. the linker shows

...
Building shared library /home/dlin/abs/local/apt/src/apt-0.9.7.7/bin/libapt-inst.so.1.5.0
Compiling file.cc to /home/dlin/abs/local/apt/src/apt-0.9.7.7/obj/methods/file.o
Building program /home/dlin/abs/local/apt/src/apt-0.9.7.7/bin/methods/file
/usr/bin/ld: dynamic variable `__fpscr_values@@GLIBC_PRIVATE' is zero size
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 004014c0
/home/dlin/abs/local/apt/src/apt-0.9.7.7/obj/methods/file.o: In function `__static_initialization_and_destruction_0(int, int)':
file.cc:(.text+0x50): undefined reference to `__dso_handle'
/usr/bin/ld: /home/dlin/abs/local/apt/src/apt-0.9.7.7/obj/methods/file.o(.text+0x6e8): unresolvable R_SH_DIR32 relocation against symbol `__fpscr_values@@GLIBC_PRIVATE'
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[2]: *** [/home/dlin/abs/local/apt/src/apt-0.9.7.7/bin/methods/file] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2

Running 4 ArchLinux including sh4twbox,server,notebook,desktop. my AUR packages, old project Arch on colinux,

Offline

Board footer

Powered by FluxBB