Hi Jakub,

thanks for reporting this. As luck would have it I had already fixed it 
yesterday (by pure coincidence), but just pushed the changes today in the 
morning.

__PIC__ being declared in a static build is really surprising to me.  I 
already made the same change you are proposing, for a different reason. The 
dynamic linker can be used ieven in static libc so runtime_env will still be
used. Normally it will be NULL a this stage and allocated later, but  I am 
considering changing this. In any case it does not hurt to set the PCB field
explicitly (even if we are setting it to NULL) to make sure it contains a 
valid value. That's why I changed it.

If it fixes the MIPS build, so much the better :-)

Cheers,
Jiri


Od: Jakub Jermář 


"Hi Jiri,

Looks like mainline,2461 broke the MIPS builds:

revno: 2461
committer: Jiri Svoboda <jiri@wiwaxia>
branch nick: main-clone
timestamp: Tue 2016-04-19 19:04:15 +0200
message:
__IN_SHARED_LIBC__ is not needed.
diff:
=== modified file 'uspace/lib/c/generic/libc.c'
--- uspace/lib/c/generic/libc.c 2015-06-06 14:41:16 +0000
+++ uspace/lib/c/generic/libc.c 2016-04-19 17:04:15 +0000
@@ -88,7 +88,7 @@
int argc;
char **argv;

-#ifdef __IN_SHARED_LIBC__
+#ifdef __PIC__
if (__pcb != NULL && __pcb->rtld_runtime != NULL) {
runtime_env = (runtime_env_t *) __pcb->rtld_runtime;
}

This should be compiled in only when runtime_env is declared, which is
only when CONFIG_RTLD is defined. However, __PIC__ appears to be defined
even for static MIPS builds for some reason, so runtime_env is
undeclared and the build fails.

This can be oviously fixed by:

=== modified file 'uspace/lib/c/generic/libc.c'
--- uspace/lib/c/generic/libc.c 2016-04-19 17:04:15 +0000
+++ uspace/lib/c/generic/libc.c 2016-04-20 19:23:05 +0000
@@ -88,7 +88,7 @@
int argc;
char **argv;

-#ifdef __PIC__
+#ifdef CONFIG_RTLD
if (__pcb != NULL && __pcb->rtld_runtime != NULL) {
runtime_env = (runtime_env_t *) __pcb->rtld_runtime;
}


But I am not sure this was your original intention as libs gets to built
twice during dynamically linked buillds - once statically and once
dynamically.

Jakub


_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel";
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to