On Monday 23 May 2005 16:51, Nix wrote:
> [Sorry for the delay: holiday and illness collide.]
Hope you get back from illness soon!
(Well, I should really give a refresh to my English, I'm still at English 98
Second Edition, maybe English XP is better!)
> `Expand', from SMTP. i.e., `what warnings?' :)
Something about linking a 32-bit library against a 64-bit executable IIRC (or
better skipping it). Actually IIRC ld did anyway the right thing. For
cross-compiling I guess however -L/usr/lib is completely foolish.
> > Also, -lutil is passed to GCC, so what the hell is happening here? And
> > which binutils/GCC versions are you using?
> binutils 2.15.94.0.2.2, 2.16.90.0.3; GCC-3.4.3.
> > However, here's probably the solution (taken from .../tt/Makefile):
> >
> > gcc -print-file-name=libutil.so
> > /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../libutil.so
> > (We need to choose libutil.a / libutil.so by hand, but that's not bad).
> >
> > I guess that a cross-GCC will make that work well.
>
> Yes, -print-file-name is the right approach, I think.
Ok, so I'll accept the patch for that...
> TLS should work --- but last I tried it UML was still allergic to
> TLS. (I guess the whole point of all this is to fix that, though.)
Well, without TT mode it already works... when you have time can you test the
attached patch?
> Oh gods, I'd quite forgotten about the myriads of non-TUN/TAP network
> drivers. (How many people use the non-TUN/TAP stuff, anyway?)
daemon support is quite used... somebody recently asked to fix SLIRP (which
had been broken for some time), pcap is useful for honeypots but I received a
request to fix it only last week (never worked in 2.6)...
> The default linker scripts for all the shared library variations say
> things to the effect of
Ok, more specifically: static libraries, as you guess below.
> Or are these copies of libpcap static libraries? If so, I can't see any
> way to forbid common symbols in *there* without breaking convenience
> libraries for many projects.
The distro should IMHO request -fno-common for libraries... actually -fcommon
should IMHO be deprecated.
> ar(1) can't tell which it's being called to
> create,
Yes, it's not a linker... I've always wondered why ar is a generic file
archiving tool used almost only for libraries... (apart for the index, yes,
but was tar so bad to use it?)
> >> (I can send you a trivial example of this sort of weird trickery if you
> >> want, but not in this mail as it's past midnight and I need some
> >> sleep. Alarm goes off at 6:30am. Working for banks sucks sometimes... :/
> > Banks? It's something I don't want to know about, I guess...
I referred to the connection between a Unix low-level programmer and a bank...
> Working in banking -> come-in-at-9am-or-earlier-or-die :( I'm *not* a
> morning person, dammit.
I guess this (even if maybe in Italy banks are not the kingdom of efficiency,
but mostly for other reasons)...
--
Paolo Giarrusso, aka Blaisorblade
Skype user "PaoloGiarrusso"
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
---
linux-2.6.git-paolo/arch/um/kernel/tt/unmap.c | 25 +++++++++++++------------
linux-2.6.git-paolo/arch/um/kernel/uml.lds.S | 1 -
2 files changed, 13 insertions(+), 13 deletions(-)
diff -puN arch/um/kernel/tt/unmap.c~uml-link-tt-mode-against-nptl arch/um/kernel/tt/unmap.c
--- linux-2.6.git/arch/um/kernel/tt/unmap.c~uml-link-tt-mode-against-nptl 2005-05-17 01:54:30.000000000 +0200
+++ linux-2.6.git-paolo/arch/um/kernel/tt/unmap.c 2005-05-17 02:08:58.000000000 +0200
@@ -1,16 +1,28 @@
/*
* Copyright (C) 2000 Jeff Dike ([EMAIL PROTECTED])
+ * Copyright (C) 2005 Paolo 'Blaisorblade' Giarrusso ([EMAIL PROTECTED])
* Licensed under the GPL
*/
#include <sys/mman.h>
+#include <linux/unistd.h>
+
+/* We can't rely on errno here! */
+#undef __syscall_return
+#define __syscall_return(type, res) \
+do { \
+ return (type) (res); \
+} while (0)
+
+static inline _syscall6(void *, mmap2, void *, start, size_t, length, int, prot, int, flags, int, fd, off_t, pgoffset)
+inline _syscall2(int, munmap, void *, start, size_t, length)
int switcheroo(int fd, int prot, void *from, void *to, int size)
{
if(munmap(to, size) < 0){
return(-1);
}
- if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){
+ if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){
return(-1);
}
if(munmap(from, size) < 0){
@@ -18,14 +30,3 @@ int switcheroo(int fd, int prot, void *f
}
return(0);
}
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
diff -puN arch/um/kernel/uml.lds.S~uml-link-tt-mode-against-nptl arch/um/kernel/uml.lds.S
--- linux-2.6.git/arch/um/kernel/uml.lds.S~uml-link-tt-mode-against-nptl 2005-05-17 01:59:37.000000000 +0200
+++ linux-2.6.git-paolo/arch/um/kernel/uml.lds.S 2005-05-17 02:00:04.000000000 +0200
@@ -17,7 +17,6 @@ SECTIONS
#ifdef MODE_TT
.thread_private : {
__start_thread_private = .;
- errno = .;
. += 4;
arch/um/kernel/tt/unmap_fin.o (.data)
__end_thread_private = .;
_