KoblentsBlog Photography
Contact About
Published Jan 31, 2015
So, a fun problem. Compiling openocd 0.8.0, using libtool 2.4.2 in /usr/bin/libtool. On some machines, this worked fine. On others, even though as far as I could tell my tools were identical, not so much. (Fedora 20, on both machines; the problematic one was a VM.)
The error looked like this.
1234
libtool: Version mismatch error. This is libtool 2.4 [snip], but the
libtool: definition of this LT_INIT comes from libtool 2.4.2.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4 [snip]
libtool: and run autoconf again.
 
Published Jan 15, 2015
I recently had an interesting bit of code to work with - functions were aliased to a mangled function name. I had changed some code, and now the project refused to compile, saying that the name could not be found. I wondered how to solve this chicken and egg problem: the mangled name is output by the compiler, but it won't compile when there are errors.
Turns out you can do it manually!
1234567891011
// Start with _Z
// Then an N
// Then the length of the class name (3), then the class name (Foo)
// Then the length of the function name (3), then the function name (bar)
// Then E
// Then return type (void - v)
#define MYFOOBARALIAS     __attribute__ ((weak, alias ("_ZN3Foo3barEv")))

void Foo::bar() {
     ...
}
 
 
« April 2015 December 2014 »
© Copyright Koblents.com, 2012-2024