linux-gcc-digest Thursday, 4 November 1999 Volume 01 : Number 400
In this issue:
About Mixed Programming....
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
Re: About Mixed Programming....
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
Re: question about using glibc2.0 and glic2.1 at the same time
binutils 2.9.5.0.16 is released.
Re: Someone help a newbie?
Writing C Programmes to Access Oracle DB from Linux
Re: Writing C Programmes to Access Oracle DB from Linux
Which Linker Script is used under Redhat Linux 6.0
Re: Writing C Programmes to Access Oracle DB from Linux
RE: Writing C Programmes to Access Oracle DB from Linux
-I /usr/local/include
Re: -I /usr/local/include
Re: -I /usr/local/include
Re: -I /usr/local/include
Re: Which Linker Script is used under Redhat Linux 6.0
Re: -I /usr/local/include
Pretty Park.exe Virus alert
Gif library (Offtopic)
RE: Gif library (Offtopic)
Profiling and threads?
Profiling timer not delivered during syscalls?
Re: Profiling timer not delivered during syscalls?
Re: Profiling timer not delivered during syscalls?
Re: Profiling timer not delivered during syscalls?
Re: Profiling timer not delivered during syscalls?
-fPIC and custom jump tables don't mix
stddef.h:170 empty declaration
Re: -fPIC and custom jump tables don't mix
Re: -fPIC and custom jump tables don't mix
See the end of the digest for information on subscribing to the linux-gcc
or linux-gcc-digest mailing lists.
----------------------------------------------------------------------
From: South Wind <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 17:32:37 +0800
Subject: About Mixed Programming....
Hello...
I want to link C and Fortran together, but I don't know
how to do it with GNU-compile system.
Could you give me a hint, or tell me where to get information
about that...
Thanks...
------------------------------
From: "Davide Libenzi" <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 11:51:20 +0200
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
> Yes, the following simple (C++) test program doesn't work under
> glibc-2.1 if compiled/linked with glibc-2.0 (tested with RedHat 5.2
> vs. RedHat 6.0)
> ---------------------------- snip --------------------------
> #include <strstream.h>
> main() {
> char x ;
> istrstream beitl (&x, 1) ;
> char y ;
> beitl.read (&y, 1) ;
> }
I can confirm that after the installation of glibc-2.1.2 on my Debian system
program using C++ iostream always crashes.
It's not a good behaviour coz the libraries has the same main version number
( 2.* and .6 for .so ) and must be binary compatible !
Cheers,
Davide.
- --
"Debian, the Freedom in Freedom."
------------------------------
From: Mark Kettenis <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 14:31:06 +0200 (MET DST)
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
From: "Davide Libenzi" <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 11:51:20 +0200
I can confirm that after the installation of glibc-2.1.2 on my Debian system
program using C++ iostream always crashes.
Please read the documentation that comes with glibc, especially the
FAQ (2.27 probably is the solition for your problems). Basically
you'll need to recompile the shared libstdc++.
It's not a good behaviour coz the libraries has the same main version number
( 2.* and .6 for .so ) and must be binary compatible !
And of course it is. Recompilation of binaries is not necessary
(except when the programs are explicitly violating the ABI, e.g. when
they are using library internals like the __setfpucw function or
depend on specific bugs in glibc-2.0 which are now fixed).
Recompilation of libraries is necessary in a few cases. Please refer
to the FAQ for details.
Mark
------------------------------
From: "Davide Libenzi" <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 15:01:12 +0200
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
Hi Mark,
> Please read the documentation that comes with glibc, especially the
> FAQ (2.27 probably is the solition for your problems). Basically
> you'll need to recompile the shared libstdc++.
the fact is that programs got crashed doesn't include shared versions of
libstdc++.
And, more, the segmentation faults occur inside libc6 ( aka glibc-2.1.2 in
my case ).
Cheers,
Davide.
- --
"Debian, the Freedom in Freedom."
------------------------------
From: Bernhard Heidegger <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 15:24:34 +0200 (CEST)
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
>>>>> ">" == Mark Kettenis <[EMAIL PROTECTED]> writes:
>> From: "Davide Libenzi" <[EMAIL PROTECTED]>
>> Date: Mon, 11 Oct 1999 11:51:20 +0200
>> I can confirm that after the installation of glibc-2.1.2 on my Debian system
>> program using C++ iostream always crashes.
>> Please read the documentation that comes with glibc, especially the
>> FAQ (2.27 probably is the solition for your problems). Basically
>> you'll need to recompile the shared libstdc++.
2.27 says (at least my version):
{AJ,CG} If you just upgrade the glibc from 2.0.x (x <= 7) to 2.1,
binaries that have been linked against glibc 2.0 will continue to
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
work.
^^^^
but this isn't true (though I agree that the statement doesn't mention
any C++ lib)
>> It's not a good behaviour coz the libraries has the same main version number
>> ( 2.* and .6 for .so ) and must be binary compatible !
>> And of course it is. Recompilation of binaries is not necessary
>> (except when the programs are explicitly violating the ABI, e.g. when
>> they are using library internals like the __setfpucw function or
>> depend on specific bugs in glibc-2.0 which are now fixed).
>> Recompilation of libraries is necessary in a few cases. Please refer
>> to the FAQ for details.
2.21. What do I need for C++ development?
[...]
{UD} But since in the case of a shared libstdc++ the version numbers should
be different existing programs will continue to work.
Note: I don't have problems with LFS and I did install the "old"
libstdc++ (2.8.0) on the new RedHat (glibc-2.1.1) box, but the simple
(strstreams) test program gets a SEGV...
Bernhard
get my pgp key from a public keyserver (keyID=0x62446355)
- -----------------------------------------------------------------------------
Bernhard Heidegger [EMAIL PROTECTED]
Hyperwave Software Research & Development
Albrechtgasse 9/2, A-8010 Graz
Voice: ++43/316/820918-25 Fax: ++43/316/820918-99
- -----------------------------------------------------------------------------
------------------------------
From: "Ernesto Caballero" <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 17:26:35 +0400
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
- ----- Original Message -----
From: Martin v. Loewis <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, October 11, 1999 10:52 AM
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
> Is there a problem with using glibc 2.1?
>
Yes there is not the _xstat symbol anymore in glibc
------------------------------
From: "Davide Libenzi" <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 15:43:08 +0200
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
Hi all,
> I can confirm that after the installation of glibc-2.1.2 on my Debian
system
> program using C++ iostream always crashes.
now I'm at work and ( sigh ! ) I don't have a Linux system.
This evening I'll post all the information about crashes ( ldd output, gdb
backtrace and disassemble near crashpoint ).
Anyway I've already posted this info at [EMAIL PROTECTED] and
[EMAIL PROTECTED] .
Cheers,
Davide.
- --
"Debian, the Freedom in Freedom."
------------------------------
From: [EMAIL PROTECTED]
Date: Mon, 11 Oct 1999 09:58:02 EDT
Subject: Re: About Mixed Programming....
You can use f2c to translate the fortran into c;
g77 is implemented as extensions to gcc, so it can handle both fortran
and c if it's properly built and installed;
I have a little script named usr/bin/f77 I guess must have been from
slackware 3.4 that will take .f and .c files through f2c and gcc to
produce an executable.
See if you have /usr/info/g77.info, if not it is part of g77. if you
have it, info -f g77 will tell you almost everything you could want to
know.
Lawson
>< Microsoft free environment
This mail client runs on Wine. Your mileage may vary.
On Mon, 11 Oct 1999, South Wind wrote:
> Hello...
>
> I want to link C and Fortran together, but I don't know
> how to do it with GNU-compile system.
>
> Could you give me a hint, or tell me where to get information
> about that...
>
> Thanks...
>
___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.
------------------------------
From: Mark Kettenis <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 17:28:27 +0200 (MET DST)
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
From: "Ernesto Caballero" <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 17:26:35 +0400
Yes there is not the _xstat symbol anymore in glibc
The symbol _xstat is an internal symbol for private use by glibc. You
shouldn't have used that symbol in your program. Use stat instead,
and recompile the offending program. And please use the glibc-bug
script to report problems with glibc. This mailing list isn't
reguarly read by glibc developers.
Mark
------------------------------
From: Mark Kettenis <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 17:33:57 +0200 (MET DST)
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
From: "Davide Libenzi" <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 15:01:12 +0200
Hi Mark,
> Please read the documentation that comes with glibc, especially the
> FAQ (2.27 probably is the solition for your problems). Basically
> you'll need to recompile the shared libstdc++.
the fact is that programs got crashed doesn't include shared versions of
libstdc++.
You might have found a genuine bug. There aren't many people who are
linking their programs against a static libstdc++, so we might have
missed it. I found your report in the bug-glibc mailing list
archives, so there is no need to send the same information again here.
In the future, please use the glibcbug script to report bugs. That
way, they end up in the bug database and run less risk of being
overlooked.
And, more, the segmentation faults occur inside libc6 ( aka glibc-2.1.2 in
my case ).
Fortunately that does not automatically imply that it is a bug in
glibc :-).
Mark
------------------------------
From: Bernhard Heidegger <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 17:46:40 +0200 (CEST)
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
>>>>> "|" == Mark Kettenis <[EMAIL PROTECTED]> writes:
|> From: "Davide Libenzi" <[EMAIL PROTECTED]>
|> Date: Mon, 11 Oct 1999 15:01:12 +0200
|> Hi Mark,
>> Please read the documentation that comes with glibc, especially the
>> FAQ (2.27 probably is the solition for your problems). Basically
>> you'll need to recompile the shared libstdc++.
|> the fact is that programs got crashed doesn't include shared versions of
|> libstdc++.
|> You might have found a genuine bug. There aren't many people who are
|> linking their programs against a static libstdc++, so we might have
Please not that I've linked the test program using shared libstdc++:
g++ -Wall -o test test.C
on a glibc-2.0.7 (stdc++-2.8.0) based RedHat 5.2 and tested on a
RedHat 6.0 (glibc-2.1.1)
|> missed it. I found your report in the bug-glibc mailing list
|> archives, so there is no need to send the same information again here.
|> In the future, please use the glibcbug script to report bugs. That
|> way, they end up in the bug database and run less risk of being
|> overlooked.
I don't know if my colleague ([EMAIL PROTECTED]) has used glibcbug
script or if he had posted his report to glibc-linux mailing list and
gnu.g++.help newsgroup only. If you want the full description of the
bug I can resend it.
Bernhard
get my pgp key from a public keyserver (keyID=0x62446355)
- -----------------------------------------------------------------------------
Bernhard Heidegger [EMAIL PROTECTED]
Hyperwave Software Research & Development
Albrechtgasse 9/2, A-8010 Graz
Voice: ++43/316/820918-25 Fax: ++43/316/820918-99
- -----------------------------------------------------------------------------
------------------------------
From: Mark Kettenis <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 18:57:05 +0200 (MET DST)
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
From: Bernhard Heidegger <[EMAIL PROTECTED]>
Date: Mon, 11 Oct 1999 17:46:40 +0200 (CEST)
Please not that I've linked the test program using shared libstdc++:
g++ -Wall -o test test.C
on a glibc-2.0.7 (stdc++-2.8.0) based RedHat 5.2 and tested on a
RedHat 6.0 (glibc-2.1.1)
Can you post a gdb backtrace of the failing strstream test program?
Mark
------------------------------
From: "Martin v. Loewis" <[EMAIL PROTECTED]>
Date: Tue, 12 Oct 1999 00:41:35 +0200
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
> The symbol _xstat is an internal symbol for private use by glibc. You
> shouldn't have used that symbol in your program. Use stat instead,
> and recompile the offending program. And please use the glibc-bug
> script to report problems with glibc. This mailing list isn't
> reguarly read by glibc developers.
Although I lost the original message, I think I remember the concern
was with some application that the user had no source to, and so was
uncapable of recompiling. In that context, I have to questions:
- - How did it come about that the application uses _xstat? That
function is not documented, and I can't see why anybody
intentionally invokes that in application code. Saying "you should
not have used it" seems like the wrong response, since it seems that
it was not actively used.
I still can't understand how the symbol got into the exectuble, but
I have a theory: Some (static) library was compiled for libc5, and
the C source used stat. As a result, this expanded to _xstat in the
object code of the library. The library continues to work with glibc
2, so the application developer continues to use it. While this is
still a mistake on part of whoever provided the library, this is not
as bad as "you fool shouldn't have used _xstat in the first
place". Please comment.
- - Now that the symbol is used, is there a mechanism to run
applications relying on it? I would think that a proper LD_PRELOAD
object could help, delegating from _xstat to __xstat. If such a
library is provided, it would help people using glibc. People could
then wrap the applications with a shell script setting LD_PRELOAD.
Regards,
Martin
------------------------------
From: Mark Kettenis <[EMAIL PROTECTED]>
Date: Tue, 12 Oct 1999 03:22:25 +0200 (CEST)
Subject: Re: question about using glibc2.0 and glic2.1 at the same time
Date: Tue, 12 Oct 1999 00:41:35 +0200
From: "Martin v. Loewis" <[EMAIL PROTECTED]>
> The symbol _xstat is an internal symbol for private use by glibc. You
> shouldn't have used that symbol in your program. Use stat instead,
> and recompile the offending program. And please use the glibc-bug
> script to report problems with glibc. This mailing list isn't
> reguarly read by glibc developers.
Although I lost the original message, I think I remember the concern
was with some application that the user had no source to, and so was
uncapable of recompiling. In that context, I have to questions:
- How did it come about that the application uses _xstat? That
function is not documented, and I can't see why anybody
intentionally invokes that in application code. Saying "you should
not have used it" seems like the wrong response, since it seems that
it was not actively used.
I still can't understand how the symbol got into the exectuble, but
I have a theory: Some (static) library was compiled for libc5, and
the C source used stat. As a result, this expanded to _xstat in the
object code of the library. The library continues to work with glibc
2, so the application developer continues to use it. While this is
still a mistake on part of whoever provided the library, this is not
as bad as "you fool shouldn't have used _xstat in the first
place". Please comment.
Another possibility is that the libc5 header was used instead of the
glibc one, because glibc was incorrectly installed. This has actually
happened before (but quite a long time ago).
- Now that the symbol is used, is there a mechanism to run
applications relying on it? I would think that a proper LD_PRELOAD
object could help, delegating from _xstat to __xstat. If such a
library is provided, it would help people using glibc. People could
then wrap the applications with a shell script setting LD_PRELOAD.
Should be possible but I don't think any of the glibc developers is
going to spend time on implementing it.
In retrospect my message was a bit harsh. Guess that's what happens
if you see too many messages from people complaining about glibc who
are not reading the documentation and do not make very much effort in
filing bug reports :-(.
Mark
------------------------------
From: [EMAIL PROTECTED] (H.J. Lu)
Date: Tue, 12 Oct 1999 09:45:15 -0700 (PDT)
Subject: binutils 2.9.5.0.16 is released.
This is the beta release of binutils 2.9.5.0.16 for Linux, which is
based on binutils 1999 1012 plus various changes. It is purely for
Linux, although it has been tested on Solaris/Sparc and Solaris/x86
from time to time.
I am planning to make the public release soon. Please test it as much
as you can.
Please report any bugs related to binutils 2.9.5.0.16 to [EMAIL PROTECTED]
For arm-linux targets, there are some important differences in behaviour
between these tools and binutils 2.9.1.0.x. The linker emulation name has
changed from elf32arm{26} to armelf_linux{26}. Also, the "-p" flag must be
passed with the linker when working with object files (or static libraries)
created using older versions of the assembler. If this flag is omitted the
linker will silently generate bad output when given old input files.
To get the correct behaviour from gcc, amend the *link section of your specs
file as follows:
*link:
%{h*} %{version:-v} %{b} %{Wl,*:%*} %{static:-Bstatic} %{shared:-shared
} %{symbolic:-Bsymbolic} %{rdynamic:-export-dynamic} %{!dynamic-linker:
- -dynamic-linker /lib/ld-linux.so.2} -X %{mbig-endian:-EB} %{mapcs-26:-m ar
melf_linux26} %{!mapcs-26:-m armelf_linux} -p
Changes from binutils 2.9.5.0.14:
1. Update from binutils 1999 1012. A gas bug which affects Linux 2.3.21
is fixed.
2. i370 update.
3. The new demangler code. You should use "--style=xxx" to select the
demnangle style instead of "--lang=xxx".
Changes from binutils 2.9.5.0.13:
1. Update from binutils 1999 0925.
2. Fix a -s and linker script bug.
Changes from binutils 2.9.5.0.12:
1. Update from binutils 1999 0922.
2. i370 update.
Changes from binutils 2.9.5.0.11:
1. Update from binutils 1999 0910. It fixed a PIC linker bug on ix86
and sparc introduced in the last release.
2. i370 update.
Changes from binutils 2.9.5.0.10:
1. Update from binutils 1999 0906. It fixed a PIC linker bug on ix86
and sparc.
2. Remove elf/hppa since it is WIP.
Changes from binutils 2.9.5.0.8:
1. Update from binutils 1999 0831. It allows spaces around '(' and ')'
in x86 FP register names.
Changes from binutils 2.9.5.0.7:
1. Update from binutils 1999 0821.
2. Some MIPS changes.
Changes from binutils 2.9.5.0.6:
1. Update from binutils 1999 0813.
2. i370 update.
Changes from binutils 2.9.5.0.5:
1. Update from binutils 1999 0809. An ELF/Sparc ld bug is fixed.
Changes from binutils 2.9.5.0.4:
1. Update from binutils 1999 0806. A Solaris/Sparc gas bug is fixed.
2. Remove mips gas patches from binutils 2.9.1.0.25.
Changes from binutils 2.9.5.0.3:
1. Update from binutils 1999 0801.
2. Support for real mode x86 gcc.
Changes from binutils 2.9.4.0.8:
1. Update from binutils 1999 0719. A libc 5 related bug fix.
2. Fix a typo in mips gas.
Changes from binutils 2.9.4.0.7:
1. Update from binutils 1999 0710. A weak symbol bug
http://egcs.cygnus.com/ml/egcs-bugs/1999-07/msg00129.html
is fixed.
Changes from binutils 2.9.4.0.6:
1. Update from binutils 1999 0626.
Changes from binutils 2.9.4.0.5:
1. Update from binutils 1999 0620.
2. Remove my fwait fix and use the one in cvs.
3. Use "--only-section=section" instead of "--extract-section=section".
for objcopy.
Changes from binutils 2.9.4.0.4:
1. Update from binutils 1999 0612.
2. Remove various temporary fixes of mine since those bugs are fixed
now.
Changes from binutils 2.9.4.0.3:
1. Update from binutils 1999 0611.
2. Remove my ELF/Alpha bfd changes.
3. Use the local symbol copy fix in binutils 1999 0611.
Changes from binutils 2.9.4.0.2:
1. Update from binutils 1999 0607.
2. Remove my Sparc hacks.
3. Fix local symbol copy.
Changes from binutils 2.9.4.0.1:
1. Update from binutils 1999 0606.
2. Restore relocation overflow checking in binutils 2.9.1.0.25 so that
Linux kernel can build.
3. Fix i370 for the new gas.
Changes from binutils 1999 0605:
1. Fix a -Bsymbolic bug for Linux/alpha.
2. Add ELF/i370.
3. Fix 8/16-bit relocations for i386.
4. Add --redefine-sym=old_form=new_form to objcopy.
5. Add "-j section" for objcopy.
6. Fix i386 disassembler for fwait.
7. Fix a Sparc asm bug.
8. Add Ada demangle support.
9. Fix MIPS/ELF bugs.
10. Add some vxworks suppport.
11. Fix a.out assembler.
The file list:
1. binutils-2.9.5.0.16.tar.bz2. Source code.
2. binutils-2.9.5.0.14-2.9.5.0.16.diff.bz2. Patch against the previous
beta source code.
3. binutils-2.9.5.0.16-1.src.rpm. Source RPM.
4. binutils-2.9.5.0.16-1.i386.rpm. X86 inary RPM for RedHat 6.1.
5. binutils-2.9.5.0.16-1.alpha.rpm. Alpha binary RPM for RedHat 6.1.
There are no gz versions of tar and diff files.
The primary ftp sites for the beta Linux binutils are:
1. ftp://ftp.valinux.com/pub/support/hjl/binutils
Thanks.
H.J. Lu
[EMAIL PROTECTED]
10/12/99
------------------------------
From: Adam Wiggins <[EMAIL PROTECTED]>
Date: Tue, 12 Oct 1999 19:19:52 -0700 (PDT)
Subject: Re: Someone help a newbie?
On Sat, 9 Oct 1999, William Scott Lockwood III wrote:
> Okay, I admit it: GCC is smarter than I am, because even after reading the
> DOCS, I STILL can't get 2.95.1 to install. Could someone post a list of
> commands to type, in order? I can configure it, and build it, I just can't
> seem to get it to install and get the system using it. HELP!
./configure
make CFLAGS='-O' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates'
bootstrap
su
[password]
make install
Note that this may not work on all distributions: for example, if your
distro has the gcc executable in /usr/bin and /usr/bin is in the path before
/usr/local/bin (which should be where gcc installs by default), then you
may end up running the old one.
Really the best thing to do is get an updated package (rpm, deb, whatever)
from your vendor.
------------------------------
From: "Mike Humphreys (DSL Ch)" <[EMAIL PROTECTED]>
Date: Fri, 15 Oct 1999 10:43:16 +1300
Subject: Writing C Programmes to Access Oracle DB from Linux
List,
Does anyone out there have any experience or knowledge of writing programmes
that access an Oracle database that is hosted on a SunOS 5.5 Host from
Linux?
I would be most interested to hear of any products or sample C code that
will enable me to start writing my own programme in this vein.
I have to date not found anything overly useful from the Oracle web site,
but then I could have missed it... Is there anything in the Public Domain
that may be useful? Are there any Commercial Packages available? I did
briefly look at the MyODBC and MySQL products, but couldn't immediately see
how to use them for my purposes. Did I miss something?
Any and all help will be most gratefully received.
Thanks,
MikeH
- -----------------------------------------------
Mike Humphreys
Datacom Systems Ltd, Christchurch, New Zealand
Phone: +64 (03) 3386504
Fax: +64 (03) 3386444
Email: [EMAIL PROTECTED]
------------------------------
From: Mario Truyens <[EMAIL PROTECTED]>
Date: Fri, 15 Oct 1999 08:25:38 +0200 (DFT)
Subject: Re: Writing C Programmes to Access Oracle DB from Linux
Hi,
I know that Oracle provides a special pre-compiler
that allows you to use special Oracle routines in
your C-code, which you then pre-compile with this
compiler and this result can then be feeded to your
regular C-compiler.
I've never used it (I use Perl to do these things)
but I think it comes with the standard Oracle Enterprise
version.
Mario
On Fri, 15 Oct 1999, Mike Humphreys (DSL Ch) wrote:
> List,
>
> Does anyone out there have any experience or knowledge of writing programmes
> that access an Oracle database that is hosted on a SunOS 5.5 Host from
> Linux?
>
> I would be most interested to hear of any products or sample C code that
> will enable me to start writing my own programme in this vein.
>
> I have to date not found anything overly useful from the Oracle web site,
> but then I could have missed it... Is there anything in the Public Domain
> that may be useful? Are there any Commercial Packages available? I did
> briefly look at the MyODBC and MySQL products, but couldn't immediately see
> how to use them for my purposes. Did I miss something?
>
> Any and all help will be most gratefully received.
>
> Thanks,
> MikeH
>
> -----------------------------------------------
> Mike Humphreys
> Datacom Systems Ltd, Christchurch, New Zealand
> Phone: +64 (03) 3386504
> Fax: +64 (03) 3386444
> Email: [EMAIL PROTECTED]
>
> -====---====---====---====---====---====---====---====---====---====---====-
> to unsubscribe email "unsubscribe linux-admin" to [EMAIL PROTECTED]
> See the linux-admin FAQ: http://www.kalug.lug.net/linux-admin-FAQ/
>
------------------------------
From: "netease" <[EMAIL PROTECTED]>
Date: Fri, 15 Oct 1999 15:49:33 +0800
Subject: Which Linker Script is used under Redhat Linux 6.0
This is a multi-part message in MIME format.
- ------=_NextPart_000_0028_01BF1724.E048EB80
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Hi, all:
I must use linker script of ld to control the output file format. There =
are example files of linker script, and I want to choose one to modify. =
There are example files named ELF-i386.x
and ELF-i386.xr, and so on. Which linker script is used as default in =
Redhat linux 6.0 on i386?
Thanks
Fred
- ------=_NextPart_000_0028_01BF1724.E048EB80
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Dgb2312 http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi, all:</FONT></DIV>
<DIV><FONT size=3D2>I must use linker script of ld to control the output =
file=20
format. There are example files of linker script, and I want to choose =
one to=20
modify. There are example files named ELF-i386.x</FONT></DIV>
<DIV><FONT size=3D2>and ELF-i386.xr, and so on. Which linker script is =
used as=20
default in Redhat linux 6.0 on i386?</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Thanks</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Fred</FONT></DIV></BODY></HTML>
- ------=_NextPart_000_0028_01BF1724.E048EB80--
------------------------------
From: Martin Bene <[EMAIL PROTECTED]>
Date: Fri, 15 Oct 1999 13:53:27 +0200
Subject: Re: Writing C Programmes to Access Oracle DB from Linux
At 10:43 15.10.99 +1300, Mike Humphreys (DSL Ch) wrote:
>Does anyone out there have any experience or knowledge of writing programmes
>that access an Oracle database that is hosted on a SunOS 5.5 Host from
>Linux?
Yes, I've done something very similar (remote oracle DB on NT).
I think the best way to get startet would be by downloading the oracle
workgroup server for linux; this contains the needed oracle sqlnet client
libraries and sample code for OCI (Oracle Call Interface) applications (in
$ORACLE_HOME/rdbms/demo).
For your programs you can either use the OCI interface (fairly lowlevel,
very powerfull, fast) or you could use pro*c, a c- language preprocessor
which converts embedded sql commands to OCI syntax. Easier to use but not
quite as efficient as doing OCI yourself, used to requiere a seperate
license (not sure about current status).
You'll probably want to look at the OCI and Pro*C Documentation, wich are
available at http://technet.oracle.com/docs/products/oracle8/doc_index.htm
(needs a free technet registration).
Bye, Martin
"you have moved your mouse, please reboot to make this change take effect"
- --------------------------------------------------
Martin Bene vox: +43-664-3251047
simon media fax: +43-316-813824-6
Andreas-Hofer-Platz 9 e-mail: [EMAIL PROTECTED]
8010 Graz, Austria
- --------------------------------------------------
finger [EMAIL PROTECTED] for PGP public key
------------------------------
From: "Neal J. Gieselman" <[EMAIL PROTECTED]>
Date: Fri, 15 Oct 1999 07:14:21 -0500
Subject: RE: Writing C Programmes to Access Oracle DB from Linux
This compiler is called Pro-C. It allows you to embed SQL like
commands within a C program. I have used it for some simple
inserts and selects on a Unixware platform years ago. It worked
very well. Please post to the list if you resolve whether Oracle
has ported this to Linux.
Mario Truyens[SMTP:[EMAIL PROTECTED]] wrote:
> Hi,
>
> I know that Oracle provides a special pre-compiler
> that allows you to use special Oracle routines in
> your C-code, which you then pre-compile with this
> compiler and this result can then be feeded to your
> regular C-compiler.
> I've never used it (I use Perl to do these things)
> but I think it comes with the standard Oracle Enterprise
> version.
>
> Mario
>
> On Fri, 15 Oct 1999, Mike Humphreys (DSL Ch) wrote:
>
> > List,
> >
> > Does anyone out there have any experience or knowledge of writing programmes
> > that access an Oracle database that is hosted on a SunOS 5.5 Host from
> > Linux?
> >
> > I would be most interested to hear of any products or sample C code that
> > will enable me to start writing my own programme in this vein.
> >
> > I have to date not found anything overly useful from the Oracle web site,
> > but then I could have missed it... Is there anything in the Public Domain
> > that may be useful? Are there any Commercial Packages available? I did
> > briefly look at the MyODBC and MySQL products, but couldn't immediately see
> > how to use them for my purposes. Did I miss something?
> >
> > Any and all help will be most gratefully received.
> >
> > Thanks,
> > MikeH
> >
------------------------------
From: "Gabor Z. Papp" <[EMAIL PROTECTED]>
Date: Mon, 18 Oct 1999 11:02:00 +0200
Subject: -I /usr/local/include
How can I tell to gcc 2.95.1, that I want include *every time*
/usr/local/include dir? Always editing Makefile works :) but I'm
searching for a fix solution.
------------------------------
From: [EMAIL PROTECTED]
Date: Mon, 18 Oct 1999 22:25:55 EDT
Subject: Re: -I /usr/local/include
Does nobody else read this list? I don't have anything as recent as
gcc-2.95.1, but gcc-2.7.2.3 will look to /usr/local/include first unless
you have configured it to look elsewhere for LOCAL_INCLUDE_DIR. Unless
you are running it as a cross-compiler, of course. It expects you to
put in /usr/local/include headers you want to override the standard
headers. I doubt they've changed that, but I'd be interested to know.
Lawson
>< Microsoft free environment
This mail client runs on Wine. Your mileage may vary.
On Mon, 18 Oct 1999, Gabor Z. Papp wrote:
> How can I tell to gcc 2.95.1, that I want include *every time*
> /usr/local/include dir? Always editing Makefile works :) but I'm
> searching for a fix solution.
>
___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.
------------------------------
From: Mark Gray <[EMAIL PROTECTED]>
Date: 19 Oct 1999 01:41:35 -0400
Subject: Re: -I /usr/local/include
"Gabor Z. Papp" <[EMAIL PROTECTED]> writes:
>
> How can I tell to gcc 2.95.1, that I want include *every time*
> /usr/local/include dir? Always editing Makefile works :) but I'm
> searching for a fix solution.
>
It is usually compiled into cpp when gcc is built:
~ $ strings /lib/cpp|grep /include
/usr/include
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include
/usr/i386-redhat-linux/include
/usr/local/include
/usr/include/g++-2
/include
~ $
If you do not want to rebuild gcc you can add it to the specs file
(/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs on my system)
I have not tried this (since I do not need to) but I would add the
- -I/usr/local/include near the beginning of the *cpp: section.
Hope this helps.
------------------------------
From: "Gabor Z. Papp" <[EMAIL PROTECTED]>
Date: Tue, 19 Oct 1999 22:21:19 +0200
Subject: Re: -I /usr/local/include
Mark Gray <[EMAIL PROTECTED]> wrote:
| It is usually compiled into cpp when gcc is built:
|
| ~ $ strings /lib/cpp|grep /include
| /usr/include
[...]
No /include in my gcc after this procedure :-o
| I have not tried this (since I do not need to) but I would add the
| -I/usr/local/include near the beginning of the *cpp: section.
I have this:
*cpp:
%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__}
%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
*cc1:
%(cc1_cpu) %{profile:-p}
*cc1plus:
So, after %(cpp_cpu)?
------------------------------
From: "Martin v. Loewis" <[EMAIL PROTECTED]>
Date: Tue, 19 Oct 1999 23:23:38 +0200
Subject: Re: Which Linker Script is used under Redhat Linux 6.0
> I must use linker script of ld to control the output file
> format. There are example files of linker script, and I want to
> choose one to modify. There are example files named ELF-i386.x and
> ELF-i386.xr, and so on. Which linker script is used as default in
> Redhat linux 6.0 on i386?
It depends on what you want to link: a relocatable object, a shared
object, or an executable. To see which one is used in a specific
linker invocation, use the ld --verbose option.
Hope this helps,
Martin
------------------------------
From: Mark Gray <[EMAIL PROTECTED]>
Date: 20 Oct 1999 02:10:24 -0400
Subject: Re: -I /usr/local/include
"Gabor Z. Papp" <[EMAIL PROTECTED]> writes:
> Mark Gray <[EMAIL PROTECTED]> wrote:
[snip]
> | I have not tried this (since I do not need to) but I would add the
> | -I/usr/local/include near the beginning of the *cpp: section.
>
> I have this:
>
> *cpp:
> %(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__}
>%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}
[snip]
> So, after %(cpp_cpu)?
That will work (I tried it using a dummy include directory).
One thing may have to watch out for is the order that directories are
searched --- people are rather unimaginative when they name things and
you can often find include files with the same name (X is a real bad
offender at this, and I swear it includes files it did not intend to.)
The -I directive will put /usr/local/include at the beginning of the
search path, and since it is the first -I it will be searched before
any directories the makefiles try to insert using their own -I
commands. If this turns out to be a problem, you will need to get
fancier -- see info gcc and the node "Preprocessor Options" and info
cpp for the gory details. You might just be safer rebuilding gcc
using the (Linux) "standard" include path order if you have a lot of
programs that use /usr/local/include and require the normal search
pattern. (Assuming /usr/local/include is in ones include search path
is probably heresy to someone somewhere :-)
The search path according to redhat-6.0 appears to be:
[snip]
~ $ su -l
~ # mkdir /usr/local/include
~ # exit
exit
~ $ strace -o duh /lib/cpp
#include <duh.h>
:1: duh.h: No such file or directory
# 1 ""
~ $ grep 'open.*/duh\.h' duh
open("/usr/local/include/duh.h", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/i386-redhat-linux/include/duh.h", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/duh.h",
O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/include/duh.h", O_RDONLY) = -1 ENOENT (No such file or
directory)
[snip]
Hope this helps.
------------------------------
From: [EMAIL PROTECTED]
Date: Mon, 25 Oct 1999 09:46:25 +0800
Subject: Pretty Park.exe Virus alert
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
- ------_=_NextPart_000_01BF1E8A.BF8CC1BA
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01BF1E8A.BF8CC1BA"
- ------_=_NextPart_001_01BF1E8A.BF8CC1BA
Content-Type: text/plain;
charset="big5"
Hi,
The attachment named "Pretty Park.exe" is a virus program .
Please be take care of it.
Sorry for the inconvenience that I caused.
Best regards,
Thanks
Best Regards
Lai Sun Loi
- ------_=_NextPart_001_01BF1E8A.BF8CC1BA
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dbig5">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2448.0">
<TITLE>Pretty Park.exe Virus alert</TITLE>
</HEAD>
<BODY>
<P><FONT COLOR=3D"#800000" FACE=3D"Arial">Hi, </FONT>
<BR><FONT COLOR=3D"#800000" =
FACE=3D"Arial"> </FONT>
<BR><FONT COLOR=3D"#800000" FACE=3D"Arial">The attachment named =
"Pretty Park.exe" is a virus program . </FONT>
<BR><FONT COLOR=3D"#800000" FACE=3D"Arial">Please be take care of it. =
</FONT>
</P>
<P> <FONT COLOR=3D"#800000" =
FACE=3D"Arial">Sorry for the inconvenience that I caused.</FONT>
</P>
<BR>
<P><FONT COLOR=3D"#800000" FACE=3D"Arial">Best regards, </FONT>
</P>
<UL>
<P><FONT COLOR=3D"#000000" SIZE=3D2 FACE=3D"Arial">Thanks</FONT><FONT =
COLOR=3D"#000000" FACE=3D"=B2=D3=A9=FA=C5=E9"> </FONT>
<BR><FONT COLOR=3D"#000000" SIZE=3D2 FACE=3D"Arial">Best =
Regards</FONT><FONT COLOR=3D"#000000" =
FACE=3D"=B2=D3=A9=FA=C5=E9"><I><BR>
</I></FONT>
</UL>
<P><FONT COLOR=3D"#000000" FACE=3D"Arial"> </FONT> <FONT =
COLOR=3D"#000000" FACE=3D"=B2=D3=A9=FA=C5=E9">Lai Sun Loi </FONT>
</P>
<P><FONT FACE=3D"=B2=D3=A9=FA=C5=E9" SIZE=3D2 =
COLOR=3D"#000000"></FONT>
</BODY>
</HTML>
- ------_=_NextPart_001_01BF1E8A.BF8CC1BA--
- ------_=_NextPart_000_01BF1E8A.BF8CC1BA
Content-Type: application/octet-stream;
name="Lai Sun Loi.vcf"
Content-Disposition: attachment;
filename="Lai Sun Loi.vcf"
BEGIN:VCARD
VERSION:2.1
N:Lai;Sun Loi
FN:Lai Sun Loi
ORG:Inventec Electronics (M) Sdn. Bhd.;Product Development
TITLE:Engineer
TEL;WORK;VOICE:604-6439566 ext 270
TEL;HOME;VOICE:604-6599837
TEL;PREF:604-6439566 ext 270
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;Multimedia Imaging Business;Plot 102=0D=0ABayan
Lepas Ind. Estate;Pulau Pin=
ang;Bayan Lepas;11900;Malaysia
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Multimedia Imaging Business=0D=0APlot
102=0D=0ABayan Lepas Ind. Estate=0D=
=0APulau Pinang, Bayan Lepas 11900=0D=0AMalaysia
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:19990322T093634Z
END:VCARD
- ------_=_NextPart_000_01BF1E8A.BF8CC1BA--
------------------------------
From: Rafael Marco de Lucas <[EMAIL PROTECTED]>
Date: Thu, 28 Oct 1999 18:48:45 +0200
Subject: Gif library (Offtopic)
Hello,
i have to write a program to build animated gifs on the fly,
can anybody tell me if there exist any library about it or
where can i find information ? thanks in advance
i apologise is this question is too off-topic (i didnt know where to ask)
regards,
Rafa
------------------------------
From: =?iso-8859-1?Q?Thomas_B=E4tzler?= <[EMAIL PROTECTED]>
Date: Thu, 28 Oct 1999 19:23:39 +0200
Subject: RE: Gif library (Offtopic)
That's gonna be tricky - Unisys has started to enforce the
LZW patent, so libs like GD have dropped GIF support.
Ciao,
Thomas
> -----Original Message-----
> From: Rafael Marco de Lucas [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, October 28, 1999 6:49 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Gif library (Offtopic)
>
>
> Hello,
>
> i have to write a program to build animated gifs on the fly,
> can anybody tell me if there exist any library about it or
> where can i find information ? thanks in advance
>
> i apologise is this question is too off-topic (i didnt know where to ask)
>
> regards,
> Rafa
>
------------------------------
From: [EMAIL PROTECTED] (Patrick J. LoPresti)
Date: 30 Oct 1999 10:38:29 -0400
Subject: Profiling and threads?
This is with stock RedHat 6.1 (package glibc-2.1.2-11).
I have a multithreaded Linux application which I want to profile with
gprof. As near as I can tell, the call graph is correct but the
timing information is taken from the main thread only. I assume this
is primarily because the profiling timer signal is only being
delivered to the main thread.
Questions:
Is the call graph data actually correct? That is, are the routines
which gather that data thread-safe?
Are profiling timers per-thread? Is it possible for me to enable it
in the other threads? Would that even work?
Any suggestions would be appreciated. Thanks!
- Pat
------------------------------
From: [EMAIL PROTECTED] (Patrick J. LoPresti)
Date: 01 Nov 1999 11:59:33 -0500
Subject: Profiling timer not delivered during syscalls?
I did this test on a Red Hat 6.1 system (glibc 2.1.2) with kernel
2.2.13.
I compiled the appended program like so:
gcc -O2 -Wall -g -pg -o foo foo.c
*** Note the -pg option; it is the whole point of the exercise ***
I ran it, and found that the profiling timer is not being delivered
while the program is in select(). In fact, I have not been able to
find a single system call during which the profiling signal is
delivered. (I do admit, so far I have only tried select(), sleep(),
and pthread_join().)
Is this behavior expected? I would have thought that time spent in
system calls would be pretty important when profiling an application.
- Pat
======================================================================
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
static __sighandler_t orig_sigprof_handler;
static void
handle_sigprof (int sig, struct sigcontext cxt)
{
fprintf (stderr, "here\n");
if (orig_sigprof_handler != NULL)
((void (*)(int, struct sigcontext))orig_sigprof_handler) (sig, cxt);
}
static void
do_nothing (void)
{
return;
}
int
main (int argc, char *argv[])
{
struct sigaction act;
int i;
struct timeval timeout = { 10, 0 };
/* Get old signal handler. */
if (__sigaction (SIGPROF, NULL, &act) != 0)
{
perror ("first sigaction");
exit (1);
}
/* Install new signal handler, preserving flags and such. */
orig_sigprof_handler = act.sa_handler;
act.sa_handler = (__sighandler_t)handle_sigprof;
if (__sigaction (SIGPROF, &act, NULL) != 0)
{
perror ("second sigaction");
exit (1);
}
select (0, NULL, NULL, NULL, &timeout);
fprintf (stderr, "select finished\n");
for (i=0 ; i<2000000 ; i++)
do_nothing();
return 0;
}
------------------------------
From: Andrea Arcangeli <[EMAIL PROTECTED]>
Date: Tue, 2 Nov 1999 00:31:54 +0100 (CET)
Subject: Re: Profiling timer not delivered during syscalls?
On 1 Nov 1999, Patrick J. LoPresti wrote:
>I ran it, and found that the profiling timer is not being delivered
There isn't any timer. -pg will only force gcc to call a function called
mcount() as first thing while entering a new function call.
>while the program is in select(). In fact, I have not been able to
Only userspace calls mcount() so only userspace will be profiled. Have a
look at the difference between the assembler generated w/ and w/o -pg to
better understand the issue.
Andrea
------------------------------
From: [EMAIL PROTECTED] (Patrick J. LoPresti)
Date: 01 Nov 1999 21:02:18 -0500
Subject: Re: Profiling timer not delivered during syscalls?
andrea> There isn't any timer. -pg will only force gcc to call a
andrea> function called mcount() as first thing while entering a new
andrea> function call.
Yes there is. When "-pg" is passed to the linker it causes it to link
against gcrt0.o instead of crt0.o. The former invokes "monstartup"
which starts the profiling timer.
If you don't believe me, try compiling the program exactly as I said
to do and then running it. You will observe that the SIGPROF handler
is invoked, just not during the select().
It turns out that this behavior is documented in the gprof info pages.
(I apologize for sending my message before completely researching the
issue.) This turns out to be inconvenient for me: I was trying to
make gprof work on a multithreaded program by intercepting SIGPROF in
the main thread and forwarding it to the child threads. But in my
multithreaded program, the main thread is frequently blocked in a
system call, so I never get the interrupts to forward. I hacked
around this by calling setitimer() in the child threads to enable the
profiling timer by hand. (Yes, I understand how information can be
lost both with mcount() and with the profiling timer in the presence
of multiple threads. But any information is better than none, which
is what you get from gprof right now for everything but the main
thread.)
andrea> Only userspace calls mcount() so only userspace will be
andrea> profiled.
mcount() generates the call graph; I am talking about the statistical
sampling provided by the profiling timer. I understand why system
calls are not sampled, but I am not sure I like it. High-latency
system calls can have a big effect on an application's performance.
If your application is slow because it makes too many slow system
calls, there does not seem to be any easy way to find that out; the
results of gprof can even be misleading.
- Pat
------------------------------
From: Andreas Schwab <[EMAIL PROTECTED]>
Date: 02 Nov 1999 13:00:48 +0100
Subject: Re: Profiling timer not delivered during syscalls?
[EMAIL PROTECTED] (Patrick J. LoPresti) writes:
|> mcount() generates the call graph; I am talking about the statistical
|> sampling provided by the profiling timer. I understand why system
|> calls are not sampled, but I am not sure I like it. High-latency
|> system calls can have a big effect on an application's performance.
|> If your application is slow because it makes too many slow system
|> calls, there does not seem to be any easy way to find that out; the
|> results of gprof can even be misleading.
gprof is not for profiling the kernel. Only user time is counted.
Andreas.
- --
Andreas Schwab "And now for something
SuSE Labs completely different."
[EMAIL PROTECTED]
SuSE GmbH, Schanz�ckerstr. 10, D-90443 N�rnberg
------------------------------
From: Andrea Arcangeli <[EMAIL PROTECTED]>
Date: Tue, 2 Nov 1999 13:58:58 +0100 (CET)
Subject: Re: Profiling timer not delivered during syscalls?
On 1 Nov 1999, Patrick J. LoPresti wrote:
>Yes there is. When "-pg" is passed to the linker it causes it to link
I never noticed the SIGPROF thing so far.
>against gcrt0.o instead of crt0.o. The former invokes "monstartup"
... because I never linked against gcrt0.o. I never used -pg with the
linker. I used it only with the compiler and I feed to the linker my own
mcount() btw.
>to do and then running it. You will observe that the SIGPROF handler
>is invoked, just not during the select().
Because the ITIMER_PROF is simply invoked by the timer interrupt when
happens while the current process is the profiled one.
In select() the profiled process sleeps so it will never be the current
process and it will never get the SIGPROF from the ITIMER_PROF.
>system call, so I never get the interrupts to forward. I hacked
>around this by calling setitimer() in the child threads to enable the
Yes, you can use the ITIMER_REAL which sends a SIGALARM. Inside the
SIGALARM callback raise(SIGPROF). I don't know if this is what you want
but doing this will interrupt select to run the signal handler for sure ;).
Andrea
------------------------------
From: Mat Hostetter <[EMAIL PROTECTED]>
Date: 3 Nov 1999 11:18:33 -0500
Subject: -fPIC and custom jump tables don't mix
I'm using x86 RedHat 6.1, both egcs-2.91.66 and gcc-2.95.2,
and the binutils-2.9.1.0.23-6 RPM.
I'm using C as the back end for a compiler. One of the things this
compiler generates is a jump table consisting of an array of x86 `jmp'
instructions. Machine-generated C code calls through this table like
this:
extern const char jump_table[];
typedef void (*func_ptr)(void);
....
((func_ptr)&jump_table[256])();
This works fine unless I both optimize and compile with -fPIC. When I
compile that way (with both the call and the jump table are in the
same file, FWIW), the above code compiles to this:
call 256+jump_table@PLT
That looks plausible, although I don't know what @PLT does. But when
I load this library with dlopen and try to run it, the code crashes.
gdb shows the above call got mis-linked as this:
call jump_table
In other words, it dropped the 256 byte offset!
Deleting the @PLT from the assembly by hand fixes the problem.
FWIW the code works without optimization because gcc generates
different (slower) code for the call that invokes a different linking
strategy.
I've appended a small test case that shows the bug. The "normal"
binary it compiles works. The one it compiles as a shared library
loses the 3 byte jump table offset and therefore calls 0 bytes into
the table, resulting in a call to `bad'.
Any thoughts? Thanks!
- -Mat
- ------ linker.c ------
#include <stdio.h>
extern const char jump_table[];
int good() { printf("Good\n"); return 0; }
int bad() { printf("Bad\n"); return 1; }
asm("jump_table:
jmp bad
jmp good");
typedef int (*func_ptr)(void);
int
call()
{
/* Call the `jmp good' instruction. When compiled -fPIC
* it loses the offset and calls the beginning of
* the array, invoking `jmp bad'.
*/
return ((func_ptr)&jump_table[2])();
}
- ----------------------
- ------ main.c ------
extern int call(void);
int
main()
{
return call();
}
- --------------------
- ------ Makefile ------
CC = egcs
CFLAGS = -O2 -Wall
all: linker pic-linker
./linker
LD_LIBRARY_PATH=. ./pic-linker
linker: main.o linker.o
$(CC) $(CFLAGS) -o $@ $^
liblinker.so: linker.c
$(CC) $(CFLAGS) -shared -fPIC $^ -o $@
pic-linker: main.o liblinker.so
$(CC) $(CFLAGS) -o $@ $^
clean:
rm -f *.o *.so linker pic-linker
- --------------------
------------------------------
From: "Gabor Z. Papp" <[EMAIL PROTECTED]>
Date: Wed, 3 Nov 1999 23:02:17 +0100
Subject: stddef.h:170 empty declaration
Since gcc 2.95.2 I often receive this warning message:
make[2]: Entering directory `/mnt/part2/src/ifmail/iflib'
gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -c lutil.c
In file included from /usr/include/bits/types.h:29,
from /usr/include/sys/types.h:30,
from lutil.c:36:
/usr/lib/gcc-lib/i486-pc-linux-gnu/2.95.2/include/stddef.h:170: warning: empty
declaration
This is my installation fault (I compiled gcc from source) or not?
------------------------------
From: [EMAIL PROTECTED]
Date: Wed, 03 Nov 1999 20:25:24 EST
Subject: Re: -fPIC and custom jump tables don't mix
On 3 Nov 1999, Mat Hostetter wrote:
> I'm using x86 RedHat 6.1, both egcs-2.91.66 and gcc-2.95.2,
> and the binutils-2.9.1.0.23-6 RPM.
>
> I'm using C as the back end for a compiler. One of the things this
> compiler generates is a jump table consisting of an array of x86 `jmp'
> instructions. Machine-generated C code calls through this table like
> this:
>
> extern const char jump_table[];
> typedef void (*func_ptr)(void);
> ....
> ((func_ptr)&jump_table[256])();
>
> This works fine unless I both optimize and compile with -fPIC. When I
> compile that way (with both the call and the jump table are in the
> same file, FWIW), the above code compiles to this:
>
> call 256+jump_table@PLT
>
> That looks plausible, although I don't know what @PLT does. But when
> I load this library with dlopen and try to run it, the code crashes.
> gdb shows the above call got mis-linked as this:
>
> call jump_table
>
> In other words, it dropped the 256 byte offset!
>
> Deleting the @PLT from the assembly by hand fixes the problem.
>
> FWIW the code works without optimization because gcc generates
> different (slower) code for the call that invokes a different linking
> strategy.
>
> I've appended a small test case that shows the bug. The "normal"
> binary it compiles works. The one it compiles as a shared library
> loses the 3 byte jump table offset and therefore calls 0 bytes into
> the table, resulting in a call to `bad'.
>
> Any thoughts? Thanks!
>
> -Mat
>
You are confusing the *!< out of PIC by defining an extern char variable
that you then use as a function. I don't think PIC should even apply to
a relative address, but I don't know how to make it abstain, except by
coding call in asm. If you substitute
asm("call jump_table+2")
for
return ((func_ptr)&jump_table[2])();
it'll work, but of course your real code will want to calculate an
offset into jump_table instead of using a constant offset. If x86 has
an indexed relative call, I don't remember how to spell it, and I have
moved recently and jettisoned all my old doco. I don't think it does.
I don't think you really need PIC in a small shared library anyway.
Your sample does work as is if ou just yank -fPIC out of the Makefile.
Wine does use both -fPIC and -O2, but all the jump tables I've noticed
are accessed with hairy asm code that also switches stacks and 16/32 bit
mode.
Lawson
>< Microsoft free environment
This mail client runs on Wine. Your mileage may vary.
___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.
------------------------------
From: [EMAIL PROTECTED] (Eric W. Biederman)
Date: 04 Nov 1999 09:38:56 -0600
Subject: Re: -fPIC and custom jump tables don't mix
Mat Hostetter <[EMAIL PROTECTED]> writes:
> I'm using x86 RedHat 6.1, both egcs-2.91.66 and gcc-2.95.2,
> and the binutils-2.9.1.0.23-6 RPM.
>
> I'm using C as the back end for a compiler. One of the things this
> compiler generates is a jump table consisting of an array of x86 `jmp'
> instructions. Machine-generated C code calls through this table like
> this:
>
> extern const char jump_table[];
> typedef void (*func_ptr)(void);
> ....
> ((func_ptr)&jump_table[256])();
>
> This works fine unless I both optimize and compile with -fPIC. When I
> compile that way (with both the call and the jump table are in the
> same file, FWIW), the above code compiles to this:
Write valid C and you have a right to complain.
As is this is invalid C, and the compiler can do anything it feels like.
In particular you should write your code more like:
typdef void (*func_ptr)(void);
extern func_ptr jump_table[];
jump_table[256]();
I can't say for this exact situation but there are optimizations
in gcc 2.95 and possibly before that take the type of the argument into
consideration.
I know of no garantees in standard C that allow you to assume you can
cast a character pointer into the address of code.
To me the code just looks silly and bad.
If it has a usefulness you might try asking how to do X.
Instead of saying when I rely on non portable code the
compiler doesn't do what I expect.
Eric
------------------------------
End of linux-gcc-digest V1 #400
*******************************
To subscribe to linux-gcc-digest, send the command:
subscribe linux-gcc-digest
in the body of a message to "[EMAIL PROTECTED]". If you want
to subscribe something other than the account the mail is coming from,
such as a local redistribution list, then append that address to the
"subscribe" command; for example, to subscribe "local-linux-gcc":
subscribe linux-gcc-digest [EMAIL PROTECTED]
A non-digest (direct mail) version of this list is also available; to
subscribe to that instead, replace all instances of "linux-gcc-digest"
in the commands above with "linux-gcc".