Search Results: "Ryan Lortie"

4 July 2011

Ross Burton: System Defaults in GSettings

Note: Florian in the comments points me at the documentation (albeit rather concise) for this in the API documentation under Vendor Overrides. GSettings, like GConf before it, allows the administrator of a system to override the default settings or lock down keys to particular settings. This is well documented in the GNOME wiki. However GConf didn't really have the concept of vendor patches. Traditionally if a Vendor wanted to change a default (say, the wallpaper) they'd have to patch the GConf schemas directly. Luckily for people who maintain distributions, GSettings provides a way of installing vendor overrides directly. It's not documented as far as I can tell so consider this a first draft at the manual... First, find the setting you want to override, dconf-editor is useful for this. Say you're making a work-orientated custom distribution so you want the shell's popup calendar to show the week number by default. Some digging in dconf-editor leads us to the folder (the "schema") with a boolean key show-weekdate that defaults to false. By changing the default of this to true, all users will have work week shown unless they explicitly set it to false. Now we've found the information we need we can write the override file. Create a new file with the extension .gschema.override, such as mydistro-tweaks.gschema.override. This file is a .ini-style keyfile, logically mapping schemas to groups and key/value pairs to (predicable) key/value pairs. The value needs to be in the GVariant serialisation format, but for things like booleans, numbers and strings these are fairly obvious. So we'd have a file that looks a little something like this:
Note that you can set multiple keys in multiple schemas in the same override file, so if we also wanted to show the date in the panel we'd have this:
Now the file is ready to be installed. Put it in a package, install to $prefix/share/glib-2.0/schemas and finally run glib-compile-schemas $prefix/share/glib-2.0/schemas in the post-install/post-remove hooks. Done! (many thanks to Ryan Lortie for telling me how vendor patches work)

22 March 2010

Ian Wienand: What exactly does -Bsymblic do? -- update

Some time ago I wrote a description of the -Bsymbolic linker flag which could do with some further explanation. The original article is a good starting place. One interesting point that I didn't go into was the potential for code optimisation -Bsymbolic brings about. I'm not sure if I missed that at the time, or the toolchain changed, both are probably equally likely! Let me recap the example...
ianw@jj:/tmp/bsymbolic$ cat Makefile 
all: test test-bsymbolic
	rm -f *.so test testsym : liboverride.c
	       $(CC) -Wall -O2 -shared -fPIC -o $< : libtest.c
	   $(CC) -Wall -O2 -shared -fPIC -o $< : libtest.c
		     $(CC) -Wall -O2 -shared -fPIC -Wl,-Bsymbolic -o $@ $<
test : test.c
     $(CC) -Wall -O2 -L. -Wl,-rpath=. -ltest -o $@ $<
test-bsymbolic : test.c
	$(CC) -Wall -O2 -L. -Wl,-rpath=. -ltest-bsymbolic -o $@ $<
$ cat liboverride.c 
#include <stdio.h>
int foo(void)
	printf("override foo called\n");
	return 0;
$ cat libtest.c 
#include <stdio.h>
int foo(void)  
    printf("libtest foo called\n");
    return 1;
int test_foo(void)  
    return foo();
$ cat test.c
#include <stdio.h>
int test_foo(void);
int main(void)
	printf("%d\n", test_foo());
	return 0;
In words; provides test_foo(), which calls foo() to do the actual work. is simply built with the flag in question, -Bsymbolic. provides the alternative version of foo() designed to override the original via a LD_PRELOAD of the library. test is built against, test-bsymbolic against Running the examples, we can see that the LD_PRELOAD does not override the symbol in the library built with -Bsymbolic.
$ ./test
libtest foo called
$ ./test-bsymbolic 
libtest foo called
$ ./test
override foo called
$ ./test-bsymbolic 
libtest foo called
There are a couple of things going on here. Firstly, you can see that the SYMBOLIC flag is set in the dynamic section, leading to the dynamic linker behaviour I explained in the original article:
ianw@jj:/tmp/bsymbolic$ readelf --dynamic ./ 
Dynamic section at offset 0x550 contains 22 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: []
 0x00000010 (SYMBOLIC)                   0x0
However, there is also an effect on generated code. Have a look at the PLTs:
$ objdump --disassemble-all ./
Disassembly of section .plt:
[... blah ...]
0000039c <foo>:
 39c:   ff a3 10 00 00 00       jmp    *0x10(%ebx)
 3a2:   68 08 00 00 00          push   $0x8
 3a7:   e9 d0 ff ff ff          jmp    37c <_init+0x30>
$ objdump --disassemble-all ./
Disassembly of section .plt:
00000374 <__gmon_start__@plt-0x10>:
 374:   ff b3 04 00 00 00       pushl  0x4(%ebx)
 37a:   ff a3 08 00 00 00       jmp    *0x8(%ebx)
 380:   00 00                   add    %al,(%eax)
00000384 <__gmon_start__@plt>:
 384:   ff a3 0c 00 00 00       jmp    *0xc(%ebx)
 38a:   68 00 00 00 00          push   $0x0
 38f:   e9 e0 ff ff ff          jmp    374 <_init+0x30>
00000394 <puts>:
 394:   ff a3 10 00 00 00       jmp    *0x10(%ebx)
 39a:   68 08 00 00 00          push   $0x8
 39f:   e9 d0 ff ff ff          jmp    374 <_init+0x30>
000003a4 <__cxa_finalize@plt>:
 3a4:   ff a3 14 00 00 00       jmp    *0x14(%ebx)
 3aa:   68 10 00 00 00          push   $0x10
 3af:   e9 c0 ff ff ff          jmp    374 <_init+0x30>
Notice the difference? There is no PLT entry for foo() when -Bsymbolic is used. Effectively, the toolchain has noticed that foo() can never be overridden and optimised out the PLT call for it. This is analogous to using "hidden" attributes for symbols, which I have detailed in another article on symbol visiblity attributes (which also goes into PLT's, if the above meant nothing to you). So -Bsymbolic does have some more side-effects than just setting a flag to tell the dynamic linker about binding rules -- it can actually result in optimised code. However, I'm still struggling to find good use-cases for -Bsymbolic that can't be better done with Version scripts and visibility attributes. I would certainly recommend using these methods if at all possible. Thanks to Ryan Lortie for comments on the original article.

14 October 2009

Robert McQueen: Boston GNOME Summit 2009

I spent this weekend in Boston for the annual GNOME summit. I really enjoyed it this year, although there were fewer attendees than previously it felt very focussed and productive. There s some cool stuff going on, and it s always great to catch up with all of the usual free software suspects in Boston. Some highlights from the weekend: I was really impressed by Jason Clinton and others summaries of the sessions, which I think are really valuable for the people who couldn t make it to the summit. He asked me to take some notes about the first Telepathy session on Saturday evening while he was taking notes about the Outreach session. Rather than lumber him with my deranged scratchings from Tomboy, I ll blog them separately.

22 March 2009

Rob Taylor: Codethink anniversary

Last month, Codethink turned 2 years old, to coincide we had a company-wide hackfest in Brussels straight after FOSDEM. It really brought home how much it d grown. Just a year ago there was just me and Mark. Now we are 8! So i m gonna take a moment to shout out to the great job these guys are doing. In order of appearence . Mark Doffman
Mark has been consistently working on transforming AT-SPI (the GNOME Accessibility and UI automation technology) into a D-Bus based cross-desktop project. From nothing a year ago, working with Mike Gorse from Novell, he s now got something that more or less works and it s getting a lot of focus and testing as we plan for GNOME 3.0. I m looking forward to a brave new future for cross toolkit accessibility on the Linux desktop. John Carr
John came to us from working on Conduit, and he s continued on his dream of making all the devices and web services of the world talk seamlessly to each other. John s been in charge of pushing the Wizbit project along and now the core of this is pretty stable, he is going to be turning his eye to working on using Wizbit for synchronisation. J rg Billeter
A stunning hacker who needs no introduction! J rg s been continuing to hack on Vala and it s getting more and more mature each week. His main work, however has been on the stunning tracker-vstore, a branch of tracker that brings full RDF capabilities, which Philip van Hoof has been blogging about. I ll be writing a biggish blog post on this soon and what RDF could really mean for the desktop experience. Karl Lattimer
Karl came to us from working on UI at Nokia. At Codethink he s continued to focus on graphics technology and user experience, bringing his keen eye to Wizbit, amongst other things. One of the most impressive things I ve seen for a while was Karl s kinetic scrolling widget for the Wizbit timeline view. I m hoping we can turn this into something more general in the future. Ryan Lortie
Another hacker who needs no introduction, Ryan s our low-level infrastructure guy. He s been working on GNIO, a library to do network operations using GIO stream abstractions and continuing to hack on DConf, which is gradually coming together. He s also been helping J rg out with Vala. Mukund Sivaraman
I knew Muks from his GIMP work, and his work on Herb is really impressive. Muks is mostly working on top secret stuff that we can t talk about, unfortunately! Peter Charlton
Our documentation guy. This guy knows how to write and knows how to take something vague and unintelligable and turn it into crystal clarity. Invaluable! Of course, through all this I ve been here, dancing about architecture and generally doing the best I can to hold the whole shebang together. I ve been mostly working on some top secret stuff which hopefully will be getting opened up soon. I ll dance about that then

21 February 2007

Ross Burton: Hero Worship

Ryan Lortie Is My Hero. I expect to see a presentation at GUADEC explaining the new panel code and how it's being integrated into G2.20, Ryan. :)

10 December 2006

Julien Blache: mbpeventd 0.6: MacBook support

mbeventd 0.6 is out, featuring support for the MacBook. Thanks go to Ryan Lortie for his macbook-backlight tool, providing the backlight control routines for the Intel GMA950, and to Enrico Tassi for bringing this to my intention with his ITP (#402193) and testing the new version. Thanks to Ludovic Rousseau who confirmed that mbpeventd was working on the Core Duo MacBook Pro. Additionally, mbpeventd should now detect all versions of the Mac Intel laptops. If it doesn’t, please drop me a mail and the output of mbpeventd -f run as root. I’m still not sure that the SMBIOS detection will work when using an EFI-aware kernel. Note: for the Core2 Duo machines, you need to use a kernel >= 2.6.19 for the function keys to work. Version 0.6 AMD64 packages and sources: Still no sound support, it’s the next item on the TODO list. It’s going to be a bit tricky, and I’m not yet sure how that should work (wrt the fact that the laptops use 2 different outputs for the headphones and speakers).

12 February 2006

Ross Burton: Sound Juicer "For All Of These Simple Things And Much More" 2.13.5

Sound Juicer "For All Of These Simple Things And Much More" 2.13.5 is out. Tarballs are available on, or from the GNOME FTP servers. Bug fixes: Translators: Priit Laes (et), ygimantas Beru ka (lt)