PATCH -- Was: link error MODE_SKAS and ! MODE_TT in 2.4.26-2 + uml.sf.net patches
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
this patch fixes the unresolved link time error with a conditional around the definition of CAN_KMALLOC
and removes the unnedded -SEARCH_DIR line from dyn_link.ld.in (this actually gets in the way if using a non- system toolchain and it's removal should not affect any properly built toolchain). --
db
Quoted 5 lines · D. Bahi
sorry about my own follow up - it's a trivial bug:
rather than wrap
CAN_KMALLOCwith multiple macro conditionals to avoid 'tracing_pid' being referenced i just added the line
Quoted 38 lines
int
tracing_pid= -1to
arch/um/kern/skas/process.cso that it parallelskern/tt/tracer.cthis might mask more critical references introduced in the future however. so the multiple macro fix would be the proper one i guess...Quoted 28 lines · D. Bahi
i think this has been like this for some time... as i remember trying to turn of TT completely in earlier releases:
CONFIG_MODE_SKAS=yCONFIG_X86_CMPXCHG=y
#CONFIG_MODE_TTis not set
#CONFIG_STATIC_LINKis not setresults in:
gcc -Wl,-T,arch/um/dyn_link.ld -Wl,-rpath,/lib -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc \
-o linuxarch/um/main.ovmlinux.o -L/usr/lib -lutil
arch/um/main.o(.text+0x363): In function `__wrap_malloc':arch/um/main.c:187: undefined reference totracing_pid' arch/um/main.o(.text+0x3e2): In function__wrap_free':arch/um/main.c:231: undefined reference totracing_pid' arch/um/main.o(.text+0x425):arch/um/main.c:235: undefined reference totracing_pid'
collect2: ld returned 1 exit status
make: *** [linux] Error 1
arch/um/main.c:187is in void *__wrap_malloc(int size)
==> else ret =um_vmalloc(size);
arch/um/main.c:231and :235 are in void__wrap_free(void *ptr)
==> if(CAN_KMALLOC())
==> if(CAN_KMALLOC())
arch/um/dyn_link.ld.in +1 -1
@@ -1,7 +1,7 @@ OUTPUT_FORMAT("ELF_FORMAT") OUTPUT_ARCH(ELF_ARCH) ENTRY(_start) -SEARCH_DIR("/usr/local/i686-pc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); + /* Do we need any of these for elf? __DYNAMIC = 0; */ SECTIONS
arch/um/main.c +5 -0
@@ -171,8 +171,13 @@return (uml_exitcode); } +#ifdef UML_CONFIG_MODE_TT #define CAN_KMALLOC () \ (kmalloc_ok && CHOOSE_MODE((getpid() != tracing_pid), 1)) +#else +#define CAN_KMALLOC () \ + (kmalloc_ok) +#endif extern void *__real_malloc (int );
Quoted 2 lines · [email protected] said:
this patch fixes the unresolved link time error with a conditional around the definition of
CAN_KMALLOC
I don't see that here. If you look at the definition of CHOOSE_MODE, you'll see that it's conditional on CONFIG_MODE_TT and CONFIG_MODE_SKAS in such a way that if a mode is configured out, any code associated with it disappears.
I think you didn't do that build from a clean pool.
Jeff
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel