Posts

Two more kernel patches

This one is MIPS related, already accepted: MIPS: Fix TIF_32BIT undefined problem when seccomp is disabled This one is proc filesystem related: [PATCH] filp->f_pos not correctly updated in proc_task_readdir The later one is also MIPS related actually, in a peculiar way: MIPS N32 does not have getdents64 system call. And because of readdir's implementation in glibc, this bug will be triggered when trying to run pstree or simply 'ls /proc/xxxx/task', where xxxx is the pid of a multithread process.

Firefox for MIPS N32 ABI

Finally, I could announce that it is working (tm). I just submitted the patches (together with O32 ABI patch) to upstream. https://bugzilla.mozilla.org/show_bug.cgi?id=482759 This is a big step forward for MIPS N32 GNU/Linux desktop. One thing to note though: It (the N32 one) would encounter bus error on a few websites, e.g. www.sina.com.cn. I will try to find out why later when I have time. For those who are into long stories, please read on: I finally sorted out the font size problem, independently. It turned out that the problem is caused by strict aliasing issue in NSPR (NetScape Portable Runtime). Specifically, when parsing css file, in order to get the font size, PR_strtod() will be used to convert string to floating point value. But because of the strict aliasing issue, certain code in PR_strtod will be optimized out if -fstrict-aliasing is turned on, which is just the case if -O2 is used. And as a result, the floating point value would be wrong, e.g. "1.5" will be con...

mips64el-unknown-linux-gnu cross toolchain building

NOTE: I just updated the command at the bottom, again. No big change. Now all should be good to go, including building on PS3, which is big endian. Crossdev is a great tool. Thanks to vapier. However, it may not work in all circumstances, although the problems may not lie in crossdev itself. For example, when creating mips64el-unknown-linux-gnu cross toolchain. The problems happen when building glibc headers. Because at that time, we don't have cross gcc yet. So some gcc options only cross gcc supports or some macros only cross gcc defines can't be used. Also happen when building gcc on big endian machines. Because of the erroneous LD_LIBRARY_PATH setting, cc1 generated in stage 1 will try to load libgcc_s.so.1 generated in stage 1, which is little endian. So I made some work-arounds. These are the three patches needed: one patch to src_compile.eblit a second patch to src_install.eblit a third patch to gcc ebuild These are all small changes, but took me a lot of time to investi...

MIPS N32 patch for xulrunner(firefox)

Finally, I have produced some results. I have watched 6 seasons of 24 and 2 seasons of Friends since late last month. So this is delayed. :P The patch is here . I think it still need some tweaks, you can always get the latest patch in my loongson overlay on http://www.gentoo-cn.org/gitweb . The produced xulrunner could run a little example: http://dev.gentoo.org/~r0bertz/xulrunner/myapp.tar.bz2 (untar the tarball, cd myapp && xulrunner-1.9 application.ini) However, I haven't got a fully functioning firefox yet. Some font size is extremely large. And sometimes bus error. I have noticed that I have used -O3 to compile it. I will try -O2/-O1 later and see if it still bus error.

glibc doesn't build with linux-header-2.6.28 on loongson

Update: It is said that this problem has already been fixed . I will test it later. Actually I intended to send this to LKML, but just before I was about to send I found there was already some discussions about this . So instead I decided to just post it here. To make long story short, please take a look at these two files first: The first file , which will become part of /usr/include/endian.h. This file defines both __LITTLE_ENDIAN and __BIG_ENDIAN. And this file will be included by the second file. The second file , which will be /usr/include/linux/byteorder.h Obviously, this test in the second file will fail: #if defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) # error Fix asm/byteorder.h to define one endianness #endif It seems that there is an inconsistency between Linux and glibc on handling __LITTLE_ENDIAN and __BIG_ENDIAN. Linux treats them like a flag, while glibc treats them like a value. glibc uses __BYTE_ORDER to determine the endianness. This problem must be...

Works I have done related to Loongson in recent months

I got a donation of a Lemote Loongson 2F box somewhere around July this year and have been working on it in my spare time since I got it. The other day I made a summary about what I have done so far and posted it on Lemote's bbs. The links is http://www.lemote.com/bbs/viewthread.php?tid=20134 My work involves toolchain, kernel, xorg-server MIPS or Loongson support and userland library/application gcc 4.4 patch. The most prominent achievement so far is an N32 ABI stage3 (well, actually just a tarball, not made using catalyst) optimized for Loongson 2F with MIPS PLT support. It is actually not that easy as you would've imagined, N32 has many problems as you can see from the above posted link. I posted it on Lemote's bbs along with some instructions of how to use it: http://www.lemote.com/bbs/viewthread.php?tid=20125 According to some testers, performance of some applications in this system has an up to 30% increase comparing with the performance of the same apps in system Usi...

EAPI 2: SRC_URI Arrows implementation in portage

Background: http://ciaranm.wordpress.com/2008/09/28/eapi-2-src_uri-arrows/ Today I found arrows in SRC_URI is not working in my box, so I took a look at the code, found something, and sent this: http://www.nabble.com/a-little-patch-related-to-arrow-in-SRC_URI-td20732745.html However, as Zac pointed out, the better solution is not to define your own fetch and resume command but rely on the default one. The default ones are defined in /etc/make.globals: FETCHCOMMAND="/usr/bin/wget -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" RESUMECOMMAND="/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" The rules of thumb is to make sure you save the file at ${DISTDIR}/${FILE}, since FILE is just the file name, doesn't include path. Previously I have fetch and resume command defined in make.conf, and have used "-P ${DISTDIR}" instead of "-O ${DISTDIR}/${FILE}". Maybe...