View Single Post
Old 09-21-2012, 03:04 PM   #687
Kai771
Just a Noob
Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.
 
Kai771's Avatar
 
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
@NiLuJe
Thanks for replying. While I still don't understand why only 2008q1-126 version of CS/MG toolchain doesn't compile kpdfview, while both earlier and later versions do, without touching the Makefile, your post gave me a lot of ideas to try (feel free to laugh if you find any of my actions particularly dumb).

I took a look inside your version of Makefile for kpdfview (actually, a diff file). I don't know why you made so many changes to it. KPDFView compiles with default Makefile without problems if I use either arm-kindle-linux-gnueabi from x-tools-glibc2.5-gcc4.2.4.tar.gz or arm-none-linux-gnueabi from CS/MG 2007q3-51, and they both work on kindle. I can only asume that you made a newer arm-kindle-linux-gnueabi, and that it was needed in your version.

I first tried simpler approach: I changed default Makefile like this:

Code:
-CFLAGS:=-O3 $(SYSROOT)
-CXXFLAGS:=-O3 $(SYSROOT)
+CFLAGS:=-O3 -fno-stack-protector -U_FORTIFY_SOURCE $(SYSROOT)
+CXXFLAGS:=-O3 -fno-stack-protector -U_FORTIFY_SOURCE $(SYSROOT)
and tried compiling it using CS/MG 2012.03, hoping it will make it work on kindle. It compiled without errors, but it didn't work on kindle. Then I changed last line to:

Code:
CXXFLAGS:=-O3 -fno-stack-protector -U_FORTIFY_SOURCE -fno-use-cxa-atexit $(SYSROOT)
Again, compiled ok, but didn't work on kindle. Then I put in all your changes from the patch file, keeping only HOST:=arm-none-linux-gnueabi unchanged, since I used that compiler. Again, same results. It compiled, but didn't work on kindle.

I reverted back to original Makefile, then went to my kindle, and typed:

$ tar -cf lib.tar /lib
$ tar -cf usrlib.tar /usr/lib

I transfered those files to PC, and unpacked them under /usr/local/k3/sysroot. I typed:
Code:
export SYSROOT=/usr/local/k3/sysroot
and tried compiling it again. This time it didn't compile.

Code:
arm-none-linux-gnueabi-gcc: warning: /usr/local/k3/sysroot: linker input file unused because linking not done
AR        libluajit.a
CC        luajit.o
arm-none-linux-gnueabi-gcc: warning: /usr/local/k3/sysroot: linker input file unused because linking not done
BUILDVM   ../lib/vmdef.lua
DYNLINK   libluajit.so
/usr/local/k3/sysroot: file not recognized: Is a directory
collect2: ld returned 1 exit status
make[2]: *** [libluajit.so] Error 1
make[2]: Leaving directory `/home/kai771/kindlepdfviewer/luajit-2.0/src'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/kai771/kindlepdfviewer/luajit-2.0'
make: *** [luajit-2.0/src/libluajit.a] Error 2
This didn't surprise me. I wasn't really expecting it to work. So I deleted /usr/local/k3/sysroot, and copied sysroot folder from x-tools-glibc2.5-gcc4.2.4.tar.gz at the same place. I tried compiling again, and I got the same result as above.

There are still things I need to read and try, but if someone is willing to help me save time, please do so. The goal is to make kpdfview compile with CS/MG 2012.03 and work on kindle. I have no other reason for doing this except curiosity, so if you're busy, please just ignore this.

Oh, and btw, I updated the guide to include instructions for CS/MG 2007q3.

Last edited by Kai771; 09-21-2012 at 03:10 PM. Reason: typo
Kai771 is offline   Reply With Quote