From soksavik@gmail.com Sun Aug 1 12:12:00 2004 From: soksavik@gmail.com (Stian Oksavik) Date: Sun, 01 Aug 2004 12:12:00 -0000 Subject: Avoiding libgcc_s.so dependency Message-ID: <8ed0eb0c0408010512753c2152@mail.gmail.com> Howdy all, I'm struggling with libgcc_s.so.1. It seems that pretty much any non-trivial program I compile ends up depending on libgcc_s.so.1. Basically, this means that I can't distribute software without also distributing this library, which is problematic for any number of reasons. I've been told to just build static binaries to avoid this problem, but this is not an option on Solaris as Sun does not include all the libraries needed to build static libraries of most software. My goal is to be able to build binaries that avoid dependencies on any third-party libraries, and only depends on Sun's bundled libraries. The current project -- and problem -- is with OpenSSH 3.8.1p1 under Solaris 9/sparc. OpenSSH picks up libcrypto.so.1 from OpenSSL (even though libcrypto.a also exists), and that in turn forces libgcc_s.so.1 into the equation -- no matter what combination of gcc and ld flags I try to keep this from happening. So, two questions: a) What is the purpose of libgcc_s.so.1, and does this purpose outweigh the inconvenience this library causes? (Including one machine we could no longer log into because removing the SMCgcc package from it disabled sshd?) b) Is there ANY way to get rid of this dependency without building a fully static binary? Thanks, -Stian From cheapRasmussen@wolfe.net Sun Aug 1 23:35:00 2004 From: cheapRasmussen@wolfe.net (Ctsavell) Date: Sun, 01 Aug 2004 23:35:00 -0000 Subject: For clients (bridesmaid) Message-ID: Dear chaepsoft customer! We have update our programs list, now we have more and new version programs. Our full catalog with 1500 fresh software titles http://maximized.rubikonaj.com/2/p/ With best regards, Chaepsoft Manager Jason AAdriatic From gcc@yapost.com Mon Aug 2 07:33:00 2004 From: gcc@yapost.com (GCC) Date: Mon, 02 Aug 2004 07:33:00 -0000 Subject: gcc driver behaviour Message-ID: <410E4F5C.1090404@yapost.com> when compile like `gcc -c one.c' find out that cc1 gets arguments like `-quiet -v one.c -quiet -dumpbase one.c -mtune=pentiumpro -auxbase one -version -o /tmp/ccMWYsbr.s' Why is it twice? From gcc@yapost.com Mon Aug 2 09:35:00 2004 From: gcc@yapost.com (GCC) Date: Mon, 02 Aug 2004 09:35:00 -0000 Subject: rebuild gcc driver Message-ID: <410E6C2A.1010403@yapost.com> is there builtin target for that? if i need only the driver functionality, which stage is enough for me? From eljay@adobe.com Mon Aug 2 12:06:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 02 Aug 2004 12:06:00 -0000 Subject: gcc driver behaviour References: <410E4F5C.1090404@yapost.com> Message-ID: <019101c47889$24928010$d3b2f882@PS253> Hi, >Why is it twice? For an explanation of the cc1 parameters, type: cc1 --help HTH, --Eljay From gdr@integrable-solutions.net Mon Aug 2 12:18:00 2004 From: gdr@integrable-solutions.net (Gabriel Dos Reis) Date: Mon, 02 Aug 2004 12:18:00 -0000 Subject: gcc driver behaviour In-Reply-To: <410E4F5C.1090404@yapost.com> References: <410E4F5C.1090404@yapost.com> Message-ID: GCC writes: | when compile like `gcc -c one.c' | find out that cc1 gets arguments like | `-quiet -v one.c -quiet -dumpbase one.c -mtune=pentiumpro -auxbase one | -version -o /tmp/ccMWYsbr.s' | | Why is it twice? What "it"? -- Gaby From kowarz@math.tu-dresden.de Mon Aug 2 12:46:00 2004 From: kowarz@math.tu-dresden.de (Andreas Kowarz) Date: Mon, 02 Aug 2004 12:46:00 -0000 Subject: gcc: speed problem with several g++ versions Message-ID: <410E3788.1080806@math.tu-dresden.de> Hello, we made some interesting experience while implementing and testing a software package, which makes use of overloaded operators. One aspect of the implementation is the speed of the resulting binaries. To find the best solution we have tested the following approaches: normal overloading and templates. The example (attachment) contains the source code for 3 programms: prog - execution without overloading progtemp - template based progover - normal overloading Compiled with g++ version 3.2 we got the following runtime: prog about 2.9 seconds progtemp about 2.9 seconds progover about 3.5 seconds It seems clear that the template based implementation should be the one to use. After recompiling with g++ version 3.4.1 we got a complete different result: prog about 2.9 seconds progtemp about 15.4 seconds !!! progover about 3.5 seconds This time the template version is not really good. :-( (Same problem with g++ version 3.3.2 on a different machine) My questions are: - Is this a known problem? - Is there a compiler switch which can solve the problem? Sincerely yours, Andreas Kowarz -------------- next part -------------- A non-text attachment was scrubbed... Name: example.tar.bz2 Type: application/x-bzip Size: 1704 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: kowarz.vcf Type: text/x-vcard Size: 339 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 256 bytes Desc: OpenPGP digital signature URL: From lrtaylor@micron.com Mon Aug 2 16:32:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Mon, 02 Aug 2004 16:32:00 -0000 Subject: Avoiding libgcc_s.so dependency Message-ID: <363801FFD7B74240A329CEC3F7FE4CC40215DB95@ntxboimbx07.micron.com> You can tell GCC to statically link in libgcc with the -static-libgcc option. However, it sounds like your ssl library was dynamically linked with it, so, so long as you're linking to the libcrypto.so instead of libcrypto.a, you're going to get it's dependencies as well. The only way to can avoid getting its dependencies as well is to either link to the static version, or to relink (i.e., rebuild) libcrypto.so so that it is statically linked to its dependencies. The linker always prefers .so files of .a files if it has a choice. You can tell it to only link to static libraries something like this: gcc -static-libgcc -Wl,-B,static -lfoo -lbar -Wl,-B,dynamic That should work, if you're using the Solaris linker. What will happen is that it will link to libfoo.a and libbar.a. If it can't find either of them (for example, if libfoo.so exists, but not libfoo.a), it will produce an error. The last argument tells the linker to prefer dynamical linking again. That way, you will get shared versions of the system libraries. Does that make sense? Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Stian Oksavik Sent: Sunday, August 01, 2004 6:13 AM To: gcc-help@gcc.gnu.org Subject: Avoiding libgcc_s.so dependency Howdy all, I'm struggling with libgcc_s.so.1. It seems that pretty much any non-trivial program I compile ends up depending on libgcc_s.so.1. Basically, this means that I can't distribute software without also distributing this library, which is problematic for any number of reasons. I've been told to just build static binaries to avoid this problem, but this is not an option on Solaris as Sun does not include all the libraries needed to build static libraries of most software. My goal is to be able to build binaries that avoid dependencies on any third-party libraries, and only depends on Sun's bundled libraries. The current project -- and problem -- is with OpenSSH 3.8.1p1 under Solaris 9/sparc. OpenSSH picks up libcrypto.so.1 from OpenSSL (even though libcrypto.a also exists), and that in turn forces libgcc_s.so.1 into the equation -- no matter what combination of gcc and ld flags I try to keep this from happening. So, two questions: a) What is the purpose of libgcc_s.so.1, and does this purpose outweigh the inconvenience this library causes? (Including one machine we could no longer log into because removing the SMCgcc package from it disabled sshd?) b) Is there ANY way to get rid of this dependency without building a fully static binary? Thanks, -Stian From takenaka@intellilink.co.jp Tue Aug 3 01:19:00 2004 From: takenaka@intellilink.co.jp (Takenaka Kazuhiro) Date: Tue, 03 Aug 2004 01:19:00 -0000 Subject: g++ -fconserve-space makes no effect Message-ID: <410EE84D.5010509@intellilink.co.jp> Hello every one. Can you help me with the following problem. I tried to compile C++ program on Fedra core 1 by g++ 3.3.2 and then compilation was aborted. (The program is first developped on Solaris 8 by Sun compiler.) Source files are like following. <<< main.C #include int var; int main(void) { var = 0; printf("var = %d\n", var); return 0; } >>> end <<< var.C int var; >>> end Commands to compile are following. <<< commands 1. g++ -o main.o -c main.C 2. g++ -o var.o -c var.C 3. g++ -o testprg main.o var.o >>> end Command 3. aborted. messages were following. <<< messages var.o(.bss+0x0): multiple definition of `var' main.o(.bss+0x0): first defined here collect2: ld returned 1 exit status >>> end I looked up option `-fconserve-space' in manual(Node: C++ Dialect Options), so I added Command 1-2 the option. But I got same result. I searched effects of '-fconserve-space' in gcc source files and found following. <<< gcc/cp/decl.c:7825 #if ! defined (ASM_OUTPUT_BSS) && ! defined (ASM_OUTPUT_ALIGNED_BSS) /* Tell the back-end to use or not use .common as appropriate. If we say -fconserve-space, we want this to save .data space, at the expense of wrong semantics. If we say -fno-conserve-space, we want this to produce errors about redefs; to do this we force variables into the data segment. */ DECL_COMMON (tem) = ((TREE_CODE (tem) != VAR_DECL || !DECL_THREAD_LOCAL (tem)) && (flag_conserve_space || ! TREE_PUBLIC (tem))); #endif >>> end I found no definition of ASM_OUTPUT_BSS for i386/linux but found ASM_OUTPUT_ALIGNED_BSS in gcc/config/i386/linux.h at 153. So I commented out the definition and build gcc, then the option makes specified effects. Now, new gcc can compile and link the program. I hava some questions: 1. The behavior of compiler is inconsistent with the manual description. Which is wrong ?. 2. What kind of side effect will be expected with the modification ? 3. Is there any better solution for the problem ? -- Takenaka Kazuhiro From hueffner@informatik.uni-tuebingen.de Tue Aug 3 07:54:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Tue, 03 Aug 2004 07:54:00 -0000 Subject: g++ -fconserve-space makes no effect In-Reply-To: <410EE84D.5010509@intellilink.co.jp> (Takenaka Kazuhiro's message of "Tue, 03 Aug 2004 10:20:13 +0900") References: <410EE84D.5010509@intellilink.co.jp> Message-ID: <87isc064ia.fsf@informatik.uni-tuebingen.de> Takenaka Kazuhiro writes: > Can you help me with the following problem. I tried to compile > C++ program on Fedra core 1 by g++ 3.3.2 and then compilation > was aborted. > > (The program is first developped on Solaris 8 by Sun compiler.) > > Source files are like following. > > <<< main.C > #include > > int var; > > int main(void) > { > var = 0; > printf("var = %d\n", var); > return 0; > } >>>> end > > <<< var.C > int var; >>>> end This is not legal in C++. One of these must be "static" or "external" (depending on whether you want them to be identical or not). -- Falk From ankitjain1580@yahoo.com Tue Aug 3 09:31:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Tue, 03 Aug 2004 09:31:00 -0000 Subject: mmx programming Message-ID: <20040803093154.74924.qmail@web52910.mail.yahoo.com> well if i have loaded the register mm0 with 8, 8 byte values and want to extract just the 5 th byte. how to do that next i want to shift 1 byte to left in a register how to shift 1 complete byte to left thanks ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From marcelo@jct.ac.il Tue Aug 3 11:01:00 2004 From: marcelo@jct.ac.il (Marcelo Roitburd) Date: Tue, 03 Aug 2004 11:01:00 -0000 Subject: evaluation of memory In-Reply-To: Message-ID: Hi, Anyone know how i can evaluation ho much memory each function take. memprof give me the real-time , the question it's it have a some function that tell me like sizeof for function ... and if have a sizeof to callss that i creat. thank you Marcelo From fcusack@fcusack.com Tue Aug 3 11:23:00 2004 From: fcusack@fcusack.com (Frank Cusack) Date: Tue, 03 Aug 2004 11:23:00 -0000 Subject: -Wl conversion in "specs" file Message-ID: <20040803042343.A15899@google.com> The *link directive in my gcc-3.4.0 specs file contains '%{Wl,*:%*}' which says to strip the -Wl, part of the arg and pass the rest to the linker. However, removal of this directive has no effect: -Wl, arguments are still passed on correctly to the linker. Is this conversion now implicit and not handled by specs? (It seems so.) If so, shouldn't this be removed from the specs file? I'd rather see it used, but at least removal doesn't give the false impression that this directive is honored. I wanted to transfrom -Wl,-rpath to -Wl,-R so that broken Makefiles which use the GNU-only -rpath will work with the Solaris linker which only accepts -R. I discovered this problem by changing the directive to '%{Wl,-rpath:-R} %{Wl,*:%*}' which had no effect. (And then I further found that removing it entirely has no effect.) I've verified with gcc -v that I'm playing with the correct specs file. thx /fc From gcc@yapost.com Tue Aug 3 12:04:00 2004 From: gcc@yapost.com (GCC) Date: Tue, 03 Aug 2004 12:04:00 -0000 Subject: how many spec files Message-ID: <410FE080.6050603@yapost.com> how many spec files using gcc driver? From kasparfischer@gmx.net Tue Aug 3 13:17:00 2004 From: kasparfischer@gmx.net (Kaspar Fischer) Date: Tue, 03 Aug 2004 13:17:00 -0000 Subject: Problem compiling GCC 3.4.1 on sparc-sun-solaris2.9 Message-ID: <5616.1091539070@www53.gmx.net> Hi all, I am trying to compile GCC 3.4.1 on sparc-sun-solaris2.9 (SunOS 5.9). Here's what I do: cd tmp tar zxf gcc-core-3.4.1.tar.gz tar zxf gcc-g++-3.4.1.tar.gz mkdir objdir cd objdir /home/fischerk/tmp/gcc-3.4.1/configure --enable-languages=c++ --prefix=/ home/fischerk/pub/gcc-3.4.1 make bootstrap The system compiler (the one I use to build GCC) has the following version: bash-2.05$ echo $CC bash-2.05$ gcc --version 2.95.3 And as you can see, I am using bash. The problem I encounter is the following: Somewhen (I guess, before even starting with stage 1), I get an error looking as follows: mv *.o insn-flags.h insn-config.h insn-codes.h insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c insn-attr.h insn-attrtab.c insn- opinit.c insn-constants.h tm-preds.h tree-check.h insn-conditions.c min- insn-modes.c insn-modes.c insn-modes.h s-flags s-config s-codes s-mlib s- genrtl s-modes s-gtype gtyp-gen.h s-output s-recog s-emit s-extract s-peep s-check s-conditions s-attr s-attrtab s-opinit s-preds s-constants s-crt0 genemit genoutput genrecog genextract genflags gencodes genconfig genpeep genattrtab genattr genopinit gengenrtl gencheck genpreds genconstants gengtype genconditions genmodes genrtl.c genrtl.h gt-*.h gtype-*.h gtype- desc.c xgcc cpp cc1 crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o crtfastmath.o gcc-cross protoize unprotoize specs collect2 collect2 gcov-iov gcov gcov-dump *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk g++ g++-cross cc1plus stage1 mv: cannot access s-crt0 mv: cannot access crt1.o mv: cannot access crti.o mv: cannot access crtn.o mv: cannot access gcrt1.o mv: cannot access gmon.o mv: cannot access crtbegin.o mv: cannot access crtend.o mv: cannot access crtfastmath.o mv: cannot access gcc-cross mv: cannot access protoize mv: cannot access unprotoize mv: cannot access specs mv: cannot access collect2 mv: cannot access gcov mv: cannot access gcov-dump mv: cannot access *.[0-9][0-9].* mv: cannot access *.[si] mv: cannot access g++-cross mv: cannot access cc1plus make[2]: [stage1-start] Error 2 (ignored) Does anybody know what the problem might be? I would very much appreciate any help because I tried lots of options (--disable-multilib, etc.) without any success. Regards, Kaspar -- NEU: WLAN-Router f??r 0,- EUR* - auch f??r DSL-Wechsler! GMX DSL = superg??nstig & kabellos http://www.gmx.net/de/go/dsl From daniel.franke@imbs.uni-luebeck.de Tue Aug 3 15:55:00 2004 From: daniel.franke@imbs.uni-luebeck.de (Daniel Franke) Date: Tue, 03 Aug 2004 15:55:00 -0000 Subject: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)? Message-ID: <200408031746.13962.daniel.franke@imbs.uni-luebeck.de> Hi all, I try to figure out how to compile the code below as 64bit executable: -- foo.cpp -- int main () { return 0; } -- The code compiles: $> g++ -m64 -O2 -g foo.cpp and: $> file a.out a.out: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped tells me that I got what I asked for, but: $> ldd a.out libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 - wrong ELF class: ELFCLASS32 libm.so.1 => /usr/lib/64/libm.so.1 libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 - wrong ELF class: ELFCLASS32 libc.so.1 => /usr/lib/64/libc.so.1 libdl.so.1 => /usr/lib/64/libdl.so.1 /usr/platform/SUNW,Sun-Blade-1000/lib/sparcv9/libc_psr.so.1 As you can see, the linker (sun ld) seems to include the 32bit versions of libstd++ and libgcc_s, instead of their 64bit companions - which are located in '/usr/local/lib/sparcv9/'. Verbose output (see below) shows that -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 actually _is_ included in the library search path. What's wrong here? Do I miss something? Compiler flags? Linker flags? A bug in g++/collect2? Something completely different? Thanks in advance for any hints :) Daniel Franke $> g++ -v -m64 -O2 -g foo.cpp Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/cc1plus -quiet -v -D__arch64__ -D__sparcv9 foo.cpp -mptr64 -mstack-bias -mno-v8plus -quiet -dumpbase foo.cpp -m64 -mcpu=v7 -auxbase foo -g -O2 -version -o /var/tmp//ccKbcjqe.s ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../sparc-sun-solaris2.8/include" #include "..." search starts here: #include <...> search starts here: /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/sparc-sun-solaris2.8 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/backward /usr/local/include /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/include /usr/include End of search list. GNU C++ version 3.4.1 (sparc-sun-solaris2.8) compiled by GNU C version 3.4.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 /usr/ccs/bin/as -V -Qy -s -xarch=v9 -o /var/tmp//ccK2DZnn.o /var/tmp//ccKbcjqe.s /usr/ccs/bin/as: Sun WorkShop 6 99/08/18 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/collect2 -V -Y P,/usr/lib/sparcv9 -Qy /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crt1.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crti.o /usr/ccs/lib/sparcv9/values-Xa.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtbegin.o -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1 -L/usr/ccs/bin/sparcv9 -L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 -L/usr/ccs/lib -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../.. -L/lib/sparcv9 -L/usr/lib/sparcv9 /var/tmp//ccK2DZnn.o -lstdc++ -lm -lgcc_s_sparcv9 -lgcc -lc -lgcc_s_sparcv9 -lgcc -lc /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtend.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtn.o ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.284 $> g++ -v reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 $> g++ -print-multi-lib .; sparcv9;@m64 -- Dipl.-Math. (FH) Daniel Franke Institut fuer Medizinische Biometrie und Statistik Medizinische Universit?t zu Luebeck Ratzeburger Allee 160, Haus 4 23538 Luebeck Telefon: 0451-500-2786 Telefax: 0451-500-2999 daniel.franke@imbs.uni-luebeck.de From wadedl@gat.com Tue Aug 3 16:07:00 2004 From: wadedl@gat.com (wadedl@gat.com) Date: Tue, 03 Aug 2004 16:07:00 -0000 Subject: gcc-3.2 Solaris 8 sun4u Enterprise 450 build/config info Message-ID: <0I1V05I03OQ98B@gat.com> Dear gcc-help: I built gcc-3.2 under Solaris 8 with some difficulty until I found the right configuration options. I thought my build info might help anyone else trying to do this: Sun architecture: sun4u ( Enterprise 450 ) Solaris 8 2/02 patched 8_Recommended and J2SE_Solaris_8_Recommended, installed with 64 bit support. pkgadd'ed into /usr/local: SMCgzip (sparc) 1.2.4a SMCmake (sparc) 3.79.1 SMCbison (sparc) 1.28 SMCflex (sparc) 2.5.4a SMCbinut (sparc) 2.11.2 SMCgcc (sparc) 3.2 PATH=/usr/local/bin:/usr/sbin:/usr/bin LD_LIBRARY_PATH=/usr/local/lib ../gcc-3.2/configure -prefix=/usr/local/gnu \ -exec-prefix=/usr/local/gnu \ --with-gnu-ld \ --with-gnu-as \ --with-as=/usr/local/bin/as \ --with-ld=/usr/local/bin/ld \ --enable-shared Yours, David L. Wade ********************************************************************** David L. Wade EMail: David.Wade@gat.com Senior Systems Programmer Analyst Ph. 858-455-3342 General Atomics Fx. 858-455-2692 3550 General Atomics Court San Diego, California 92121 ********************************************************************** opinions, conclusions, or recommendations expressed above are my own and do not necessarily represent the views of my employer. From ssarnald@gmail.com Tue Aug 3 16:07:00 2004 From: ssarnald@gmail.com (Arnald Samthambi) Date: Tue, 03 Aug 2004 16:07:00 -0000 Subject: Support for Thumb PLT entries Message-ID: <94420f6d04080309074bb39884@mail.gmail.com> Hi, I am not quite sure whether this question belongs on the list but I'll start here. Answers and or referrals to other lists are hoped for. I am trying to create shared library using arm-elf-gcc for THUMB (using option -mthumb). It seems to me that the arm-elf-ld does not generate PLT entries for extern functions, however it generates GOT entries. I am able to see the PLT and GOT entries in ARM mode. I am using: Binutils - 2.14 Gcc - 4.4.1 Is it a known problem in GCC or am I missing anything? >From the link http://sources.redhat.com/ml/binutils/2002-07/msg00578.html I understand that the issues is known and fixed, am I making sense here? Thanks in advance Arnald From lrtaylor@micron.com Tue Aug 3 16:25:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Tue, 03 Aug 2004 16:25:00 -0000 Subject: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)? Message-ID: <363801FFD7B74240A329CEC3F7FE4CC403096036@ntxboimbx07.micron.com> GCC's 64-bit libraries are in a different directory. For example, try looking under /usr/local/lib for a directory named sparcv9 or something. Or, if GCC's libraries are installed into a GCC-specific sub directory somewhere, try looking there. You'll then need to modify your LD_LIBRARY_PATH to look there before /usr/local/lib. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Daniel Franke Sent: Tuesday, August 03, 2004 9:46 AM To: gcc-help@gcc.gnu.org Subject: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)? Hi all, I try to figure out how to compile the code below as 64bit executable: -- foo.cpp -- int main () { return 0; } -- The code compiles: $> g++ -m64 -O2 -g foo.cpp and: $> file a.out a.out: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped tells me that I got what I asked for, but: $> ldd a.out libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 - wrong ELF class: ELFCLASS32 libm.so.1 => /usr/lib/64/libm.so.1 libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 - wrong ELF class: ELFCLASS32 libc.so.1 => /usr/lib/64/libc.so.1 libdl.so.1 => /usr/lib/64/libdl.so.1 /usr/platform/SUNW,Sun-Blade-1000/lib/sparcv9/libc_psr.so.1 As you can see, the linker (sun ld) seems to include the 32bit versions of libstd++ and libgcc_s, instead of their 64bit companions - which are located in '/usr/local/lib/sparcv9/'. Verbose output (see below) shows that -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 actually _is_ included in the library search path. What's wrong here? Do I miss something? Compiler flags? Linker flags? A bug in g++/collect2? Something completely different? Thanks in advance for any hints :) Daniel Franke $> g++ -v -m64 -O2 -g foo.cpp Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/cc1plus -quiet -v -D__arch64__ -D__sparcv9 foo.cpp -mptr64 -mstack-bias -mno-v8plus -quiet -dumpbase foo.cpp -m64 -mcpu=v7 -auxbase foo -g -O2 -version -o /var/tmp//ccKbcjqe.s ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../sparc-sun-solaris2.8/include" #include "..." search starts here: #include <...> search starts here: /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/sparc-sun-solaris2.8 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/backward /usr/local/include /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/include /usr/include End of search list. GNU C++ version 3.4.1 (sparc-sun-solaris2.8) compiled by GNU C version 3.4.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 /usr/ccs/bin/as -V -Qy -s -xarch=v9 -o /var/tmp//ccK2DZnn.o /var/tmp//ccKbcjqe.s /usr/ccs/bin/as: Sun WorkShop 6 99/08/18 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/collect2 -V -Y P,/usr/lib/sparcv9 -Qy /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crt1.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crti.o /usr/ccs/lib/sparcv9/values-Xa.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtbegin.o -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1 -L/usr/ccs/bin/sparcv9 -L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 -L/usr/ccs/lib -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../.. -L/lib/sparcv9 -L/usr/lib/sparcv9 /var/tmp//ccK2DZnn.o -lstdc++ -lm -lgcc_s_sparcv9 -lgcc -lc -lgcc_s_sparcv9 -lgcc -lc /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtend.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtn.o ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.284 $> g++ -v reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 $> g++ -print-multi-lib .; sparcv9;@m64 -- Dipl.-Math. (FH) Daniel Franke Institut fuer Medizinische Biometrie und Statistik Medizinische Universit?t zu Luebeck Ratzeburger Allee 160, Haus 4 23538 Luebeck Telefon: 0451-500-2786 Telefax: 0451-500-2999 daniel.franke@imbs.uni-luebeck.de From daniel.franke@imbs.uni-luebeck.de Tue Aug 3 16:41:00 2004 From: daniel.franke@imbs.uni-luebeck.de (Daniel Franke) Date: Tue, 03 Aug 2004 16:41:00 -0000 Subject: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)? In-Reply-To: <363801FFD7B74240A329CEC3F7FE4CC403096036@ntxboimbx07.micron.com> References: <363801FFD7B74240A329CEC3F7FE4CC403096036@ntxboimbx07.micron.com> Message-ID: <200408031832.08846.daniel.franke@imbs.uni-luebeck.de> Am Dienstag, 3. August 2004 18:24 schrieb lrtaylor@micron.com: > GCC's 64-bit libraries are in a different directory. For example, try > looking under /usr/local/lib for a directory named sparcv9 or something. > Or, if GCC's libraries are installed into a GCC-specific sub directory > somewhere, try looking there. You'll then need to modify your > LD_LIBRARY_PATH to look there before /usr/local/lib. > > Thanks, > Lyle Oh my goddess! Lyle, thank you very much. I hadn't had '/usr/local/lib/sparcv9' in my LD_LIBRARY_PATH. I somehow thought the libs should be found anyway (magic?). I knew it must be something really stupid! Thanks a lot! Daniel -- Dipl.-Math. (FH) Daniel Franke Institut fuer Medizinische Biometrie und Statistik Medizinische Universit?t zu Luebeck Ratzeburger Allee 160, Haus 4 23538 Luebeck Telefon: 0451-500-2786 Telefax: 0451-500-2999 daniel.franke@imbs.uni-luebeck.de From kasparfischer@gmx.net Tue Aug 3 18:46:00 2004 From: kasparfischer@gmx.net (Kaspar Fischer) Date: Tue, 03 Aug 2004 18:46:00 -0000 Subject: Problem compiling GCC 3.4.1 on sparc-sun-solaris2.9 Message-ID: <708.1091558812@www38.gmx.net> After having reread the architecture-specific configuration documentation, I also tried CC="cc -xildoff -xarch=v9" /home/fischerk/tmp/gcc-3.4.1/configure --prefix=/home/fischerk/pub/gcc -3.4.1 --enable-shared --enable-languages=c++ make bootstrap and CC="cc -xildoff -xarch=v9" /home/fischerk/tmp/gcc-3.4.1/configure --prefix=/home/fischerk/pub/gcc -3.4.1 --enable-shared --enable-languages=c++ --with-as=/usr/ccs/bin/as -- with-ld=/usr/ccs/bin/ld make bootstrap Both attempts failed again. Has anybody had similar difficulties? Many thanks, Kaspar -- NEU: WLAN-Router f??r 0,- EUR* - auch f??r DSL-Wechsler! GMX DSL = superg??nstig & kabellos http://www.gmx.net/de/go/dsl From Vernon.Sauder@spirentcom.com Wed Aug 4 00:27:00 2004 From: Vernon.Sauder@spirentcom.com (Sauder, Vernon) Date: Wed, 04 Aug 2004 00:27:00 -0000 Subject: Designated Initialization in g++ Message-ID: <136BC61723D0D711A22000B0D068A97D012A8BD9@minotaur.hekimian.com> When is support for Designated Initialization per C99 expected to be implemented in g++? Is the current aggregate initialization support to be deprecated at that time? Example: struct flock f = { l_type: F_UNLCK, l_len: 0 }; << currently supported struct flock f = { .l_type = F_UNLCK, .l_len = 0 }; << C99 Vernon Sauder Office: +1 301.417.1798 Mobile: +1 240.994.2226 Email: Vernon.Sauder@spirentcom.com From Matthew.Thyer@dsto.defence.gov.au Wed Aug 4 06:39:00 2004 From: Matthew.Thyer@dsto.defence.gov.au (Thyer, Matthew) Date: Wed, 04 Aug 2004 06:39:00 -0000 Subject: Help: Unable to achieve satisfactory outcome from test suite for GCC 3.4.1 on Solaris 8 Message-ID: I can build GCC with "make bootstrap" however I am unable to get good results from the test suite. Using the method documented in this e-mail, I am getting this from the test suite: % egrep '==|^#' ../make_check.log | grep -v "tests ===" === gcc Summary === # of expected passes 24948 # of unexpected successes 1 # of expected failures 72 # of unresolved testcases 5 # of untested testcases 7 # of unsupported tests 312 === g++ Summary === # of expected passes 8419 # of unexpected failures 1117 # of expected failures 71 # of unresolved testcases 14 # of unsupported tests 67 === g77 Summary === # of expected passes 1115 # of unexpected failures 617 # of unresolved testcases 14 # of unsupported tests 6 === objc Summary === # of expected passes 822 # of unexpected failures 530 # of unsupported tests 8 === libstdc++ Summary === # of expected passes 1409 # of unexpected failures 1287 # of expected failures 6 === libffi Summary === # of expected passes 77 # of unexpected failures 77 # of unsupported tests 2 === libjava Summary === # of expected passes 1486 # of unexpected failures 900 # of expected failures 5 # of untested testcases 907 =================== =================== When I compare this with "http://gcc.gnu.org/ml/gcc-testresults/2004-07/msg00258.html" I see that I have passed the first set of tests pretty well (those summarised under "gcc Summary") however all the other tests fail a lot more than expected. The methodology I used to build and test the software is as follows: Log on to "Server" after ensuring that your ~/.cshrc is similar to the attached file to ensure a clean environment. Download the source archive for GCC 3.4.1 from the following location: ftp://mirror.aarnet.edu.au/pub/gcc/releases/gcc-3.4.1/gcc-3.4.1.tar.bz2 Download binary packages for GCC version 2.95.3 and gmake 3.79.1 which have been built for a prefix other than /usr/local (to not interfere with users). Binaries built for prefix /opt/sfw are available from: "Solaris 8 2/02 Companion Software individual packages download" at: "http://wwws.sun.com/software/solaris/freeware/pkgs_download.html". These packages also require "gcmn-1.0-pkg.zip" which is available from the same location. Put the downloaded archives "gcc-3.4.1.tar.bz2", "gcc-2.95.3-pkg.zip", "gmake-3.79.1-pkg.zip" and "gcmn-1.0-pkg.zip" in your home directory. Run the following build script (as yourself not root but remember to prep your sudo first): #!/bin/sh # Make a temporary directory and change to it TMP_BASE=/var/tmp/$USER mkdir -p ${TMP_BASE}/SCIS_Change_$$ cd ${TMP_BASE}/SCIS_Change_$$ # Unpack the GCC source archive using GNU tar bzcat $HOME/gcc-3.4.1.tar.bz2 | /usr/local/bin/tar -xf - # Unpack and install the binary packages (those prefixed with /opt/sfw) unzip $HOME/gcmn-1.0-pkg.zip unzip $HOME/gcc-2.95.3-pkg.zip unzip $HOME/gmake-3.79.1-pkg.zip sudo /usr/sbin/pkgadd -n -d SFWgcmn all sudo /usr/sbin/pkgadd -n -d SFWgcc all sudo /usr/sbin/pkgadd -n -d SFWgmake all # Now configure GCC # Set necessary environment variables CC=/opt/sfw/bin/gcc CONFIG_SHELL=/bin/ksh export CC CONFIG_SHELL # Configure in a separate build directory mkdir objdir cd objdir ${TMP_BASE}/SCIS_Change_$$/gcc-3.4.1/configure --with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld --with-ld=/usr/local/bin/ld --with-tune=ultrasparc --enable-languages=c,c++,f77,java,objc --disable-nls >../configure.log 2>&1 # Build using the binary GNU make I installed earlier /opt/sfw/bin/gmake bootstrap >../make_bootstrap.log 2>&1 When the build script completes, the software needs to be tested in accordance with the testing plan which is included below: In order to complete testing, additional software being "DejaGnu 1.4.1 or 1.4.3 or later" is required. The source code for "DejaGnu 1.4.3" can be obtained from: "ftp://mirror.aarnet.edu.au/pub/gnu/dejagnu/dejagnu-1.4.3.tar.gz". This downloaded archive should be placed in your home directory. DejaGnu 1.4.3 requires Expect which requires Tk which requires Tcl. All of this software will need to be installed under a prefix which is not being used by clients. Expect, Tk and Tcl are all available prebuilt for the prefix "/opt/sfw" from: "Solaris 8 2/02 Companion Software individual packages download" at: "http://wwws.sun.com/software/solaris/freeware/pkgs_download.html". The files to be downloaded are: "expect-5.31-pkg.zip", "Tk-8.3.3-pkg.zip" and "Tcl-8.3.3-pkg.zip". Install the dependencies for "DejaGnu 1.4.3" first as follows: Log on to "Server" after ensuring that your ~/.cshrc is similar to the attached file to ensure a clean environment. % cd /var/tmp/$USER % unzip $HOME/Tcl-8.3.3-pkg.zip % unzip $HOME/Tk-8.3.3-pkg.zip % unzip $HOME/expect-5.31-pkg.zip % sudo /usr/sbin/pkgadd -n -d SFWtcl all % sudo /usr/sbin/pkgadd -n -d SFWtk all % sudo /usr/sbin/pkgadd -n -d SFWexpct all Then build and install "DejaGnu 1.4.3" as follows: Unpack the source archive for "DejaGnu 1.4.3" as follows: % rehash % gzcat ~/dejagnu-1.4.3.tar.gz | tar -xf - % mkdir dejagnu-objdir % cd dejagnu-objdir % setenv CC /opt/sfw/bin/gcc % /var/tmp/$USER/dejagnu-1.4.3/configure --srcdir=/var/tmp/$USER/dejagnu-1.4.3 --prefix=/opt/SCIS sparc-sun-solaris2 % /opt/sfw/bin/gmake CC=$CC % sudo /opt/sfw/bin/gmake install Now run the GCC 3.4.1 test suite as follows (NOTE the number "18746" will need to be substituted with whatever your directory is as a result of the Build phase): % rehash % cd /var/tmp/$USER/SCIS_Change_18746/objdir % sudo /opt/sfw/bin/gmake -k check >& ../make_check.log When the test suite has completed, run the following command to summarise the test results: % egrep '==|^#' ../make_check.log | grep -v "tests ===" Compare the output with the result published at "http://gcc.gnu.org/ml/gcc-testresults/2004-07/msg00258.html". Can anyone explain why I get these results? Would it help to install the compiler and then use itself to build itself? From gcc@yapost.com Wed Aug 4 07:44:00 2004 From: gcc@yapost.com (GCC) Date: Wed, 04 Aug 2004 07:44:00 -0000 Subject: add external compiler Message-ID: <4110F50E.7030802@yapost.com> I want to add external compiler for gcc driver. Till now just did cc1 like link to my compiler and change cc1_options. Is there better way to proceed? From gcc@yapost.com Wed Aug 4 07:50:00 2004 From: gcc@yapost.com (GCC) Date: Wed, 04 Aug 2004 07:50:00 -0000 Subject: gcc driver behaviour In-Reply-To: References: <410E4F5C.1090404@yapost.com> Message-ID: <4110F67D.20303@yapost.com> Gabriel Dos Reis wrote: >GCC writes: > >| when compile like `gcc -c one.c' >| find out that cc1 gets arguments like >| `-quiet -v one.c -quiet -dumpbase one.c -mtune=pentiumpro -auxbase one >| -version -o /tmp/ccMWYsbr.s' >| >| Why is it twice? > >What "it"? > >-- Gaby > > > > `-quiet' From alexvn@connect.to Wed Aug 4 08:57:00 2004 From: alexvn@connect.to (Alex Vinokur) Date: Wed, 04 Aug 2004 08:57:00 -0000 Subject: speed problem with several g++ versions References: <410E3788.1080806@math.tu-dresden.de> Message-ID: "Andreas Kowarz" wrote in message news:410E3788.1080806@math.tu-dresden.de... > > Hello, > > we made some interesting experience while implementing and testing a software > package, which makes use of overloaded operators. One aspect of the > implementation is the speed of the resulting binaries. To find the best solution > we have tested the following approaches: normal overloading and templates. The > example (attachment) contains the source code for 3 programms: > > prog - execution without overloading > progtemp - template based > progover - normal overloading > > Compiled with g++ version 3.2 we got the following runtime: > prog about 2.9 seconds > progtemp about 2.9 seconds > progover about 3.5 seconds > It seems clear that the template based implementation should be the one to use. > > After recompiling with g++ version 3.4.1 we got a complete different result: > prog about 2.9 seconds > progtemp about 15.4 seconds !!! > progover about 3.5 seconds > This time the template version is not really good. :-( > (Same problem with g++ version 3.3.2 on a different machine) > > My questions are: > - Is this a known problem? > - Is there a compiler switch which can solve the problem? > > Sincerely yours, > > Andreas Kowarz > tar (GNU tar) 1.13.25 doesn't extract files from example.tar which contains tested sources. -- Alex Vinokur http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn From hueffner@informatik.uni-tuebingen.de Wed Aug 4 09:12:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Wed, 04 Aug 2004 09:12:00 -0000 Subject: gcc: speed problem with several g++ versions In-Reply-To: <410E3788.1080806@math.tu-dresden.de> (Andreas Kowarz's message of "Mon, 02 Aug 2004 14:46:00 +0200") References: <410E3788.1080806@math.tu-dresden.de> Message-ID: <87657zi7x7.fsf@informatik.uni-tuebingen.de> Andreas Kowarz writes: > we made some interesting experience while implementing and testing a > software package, which makes use of overloaded operators. One aspect > of the implementation is the speed of the resulting binaries. To find > the best solution we have tested the following approaches: normal > overloading and templates. The example (attachment) contains the > source code for 3 programms: > > prog - execution without overloading > progtemp - template based > progover - normal overloading > > Compiled with g++ version 3.2 we got the following runtime: > prog about 2.9 seconds > progtemp about 2.9 seconds > progover about 3.5 seconds > It seems clear that the template based implementation should be the one to use. > > After recompiling with g++ version 3.4.1 we got a complete different result: > prog about 2.9 seconds > progtemp about 15.4 seconds !!! > progover about 3.5 seconds > This time the template version is not really good. :-( > (Same problem with g++ version 3.3.2 on a different machine) > > My questions are: > - Is this a known problem? > - Is there a compiler switch which can solve the problem? This seems to be something target specific; on Alpha, I get the exact same time for all three programs with both 3.3 and 3.4. I guess one would have to look at the assembly to see what causes it... might be register allocation or inlining. You could try changing inline settings and -fomit-frame-pointer and -fnew-ra. -- Falk From alexvn@connect.to Wed Aug 4 09:22:00 2004 From: alexvn@connect.to (Alex Vinokur) Date: Wed, 04 Aug 2004 09:22:00 -0000 Subject: gcc: speed problem with several g++ versions References: <410E3788.1080806@math.tu-dresden.de> <87657zi7x7.fsf@informatik.uni-tuebingen.de> Message-ID: "Falk Hueffner" wrote in message news:87657zi7x7.fsf@informatik.uni-tuebingen.de... [snip] > This seems to be something target specific; [snip] Yes, performance of the same compiler on different targets is quite different. See, for instance: http://article.gmane.org/gmane.comp.lang.c%2B%2B.perfometer/37 http://groups.google.com/groups?selm=biihim%249opf4%241%40ID-79865.news.uni-berlin.de -- Alex Vinokur http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn From frostflare@bol.com.br Wed Aug 4 14:25:00 2004 From: frostflare@bol.com.br (frostflare) Date: Wed, 04 Aug 2004 14:25:00 -0000 Subject: arm-elf-gcc __irq Message-ID: Hi, I want to know how use __irq (interruption) at arm-elf- gcc to ARM7TDMI, i try to compile a C program with this parameter (__irq) and it say "parse error". Please can somebody help me or tell me about how i fix it. Wellington Brazil __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From kowarz@math.tu-dresden.de Wed Aug 4 14:32:00 2004 From: kowarz@math.tu-dresden.de (Andreas Kowarz) Date: Wed, 04 Aug 2004 14:32:00 -0000 Subject: gcc: speed problem with several g++ versions In-Reply-To: <87657zi7x7.fsf@informatik.uni-tuebingen.de> References: <410E3788.1080806@math.tu-dresden.de> <87657zi7x7.fsf@informatik.uni-tuebingen.de> Message-ID: <4110F385.2020705@math.tu-dresden.de> Hi, thank you for the quick response and your suggestions. According to platform dependent results: We have testes the old example on a Pentium3 700 MHz and on an Athlon-XP 1666 MHz. The problem with the template version occurred for both machines. However, we have a new example which leads to much more interesting results on these machines by using gcc332 and gcc341, respectively. The new example contains some overloaded basic operators, which can be used for very simple derivative calculations. The interesting observations concern the runtime, again. On the Pentium3 the function evaluation (prog) needs more than twice the time than calculating function AND derivative (progover). (Somebody should wake me up :-) ). The difference on the Athlon-XP is not that high but has the same (unbelievable) signature. By the way: We will not optimize our code for a specific compiler and version since we do not know, which compiler our users will apply. But we seem to have a good point for discussion about speed, now. I hope this information is useful for gcc development. Sincerely yours, Andreas Kowarz ================================================================================ Falk Hueffner wrote: > Andreas Kowarz writes: > > >>we made some interesting experience while implementing and testing a >>software package, which makes use of overloaded operators. One aspect >>of the implementation is the speed of the resulting binaries. To find >>the best solution we have tested the following approaches: normal >>overloading and templates. The example (attachment) contains the >>source code for 3 programms: >> >>prog - execution without overloading >>progtemp - template based >>progover - normal overloading >> >>Compiled with g++ version 3.2 we got the following runtime: >>prog about 2.9 seconds >>progtemp about 2.9 seconds >>progover about 3.5 seconds >>It seems clear that the template based implementation should be the one to use. >> >>After recompiling with g++ version 3.4.1 we got a complete different result: >>prog about 2.9 seconds >>progtemp about 15.4 seconds !!! >>progover about 3.5 seconds >>This time the template version is not really good. :-( >>(Same problem with g++ version 3.3.2 on a different machine) >> >>My questions are: >>- Is this a known problem? >>- Is there a compiler switch which can solve the problem? > > > This seems to be something target specific; on Alpha, I get the exact > same time for all three programs with both 3.3 and 3.4. I guess one > would have to look at the assembly to see what causes it... might be > register allocation or inlining. You could try changing inline > settings and -fomit-frame-pointer and -fnew-ra. > -------------- next part -------------- A non-text attachment was scrubbed... Name: template_example_3.tar.bz2 Type: application/x-bzip Size: 2375 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: kowarz.vcf Type: text/x-vcard Size: 339 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 256 bytes Desc: OpenPGP digital signature URL: From mldb@gmx.net Wed Aug 4 15:31:00 2004 From: mldb@gmx.net (Marco Manfredini) Date: Wed, 04 Aug 2004 15:31:00 -0000 Subject: gcc: speed problem with several g++ versions In-Reply-To: <4110F385.2020705@math.tu-dresden.de> References: <410E3788.1080806@math.tu-dresden.de> <87657zi7x7.fsf@informatik.uni-tuebingen.de> <4110F385.2020705@math.tu-dresden.de> Message-ID: <200408041726.34586.mldb@gmx.net> On Wednesday 04 August 2004 16:32, Andreas Kowarz wrote: > According to platform dependent results: > We have testes the old example on a Pentium3 700 MHz and on an Athlon-XP > 1666 MHz. The problem with the template version occurred for both machines. Hmm. Did you try marking you template functions inline? template functions aren't neccesarily inlined _automatically_ with all versions of gcc. I've got this: progtemp without inline 10.9 sec. Then I tagged the _declarations_ inline: template class adouble { public: inline adouble(); inline adouble(const T v); inline adouble(const T v1, const T v2); inline void operator = (const T v); inline void operator = (const adouble& v); etc... An I've got: progtemp with inline 0.7 sec. Greetings Marco From milindc@telesoftnet.com Wed Aug 4 15:43:00 2004 From: milindc@telesoftnet.com (Milind Changire) Date: Wed, 04 Aug 2004 15:43:00 -0000 Subject: __attribute__((packed)) behavior with gcc and g++ [gcc version 3.2 20020903] Message-ID: <1091634515.9797.49.camel@mitelLinux> Following peice of code compiles under gcc and reports the size of struct as 11, as expected. However g++ just does not like the code and reports an error 'semicolon missing after enum declaration' g++ 3.4.1 reports a 'warning: `packed' attribute ignored' and I get the size of struct as 14. I'd like to pack structures and cause enums to use mininum possible space, mostly a single byte, under gcc 3.2. Arch: i686 ------ #include #pragma pack(1) typedef enum { Red, Green, Blue } __attribute__((packed)) MYENUM; struct pragma_struct_t { char ch; int val; char ch2; long len; MYENUM color; }; #pragma pack(0) int main() { printf("sizeof(struct pragma_struct_t)= %d\n", sizeof(struct pragma_struct_t)); return 0; } ------ How do I get this to work under g++ 3.2? Any patches or suggestions? -Milind From milindc@telesoftnet.com Wed Aug 4 15:58:00 2004 From: milindc@telesoftnet.com (Milind Changire) Date: Wed, 04 Aug 2004 15:58:00 -0000 Subject: __attribute__((packed)) behavior with gcc and g++ [gcc version 3.2 20020903] Message-ID: <1091634515.9797.49.camel@mitelLinux> Following peice of code compiles under gcc and reports the size of struct as 11, as expected. However g++ just does not like the code and reports an error 'semicolon missing after enum declaration' g++ 3.4.1 reports a 'warning: `packed' attribute ignored' and I get the size of struct as 14. I'd like to pack structures and cause enums to use mininum possible space, mostly a single byte, under gcc 3.2. Arch: i686 ------ #include #pragma pack(1) typedef enum { Red, Green, Blue } __attribute__((packed)) MYENUM; struct pragma_struct_t { char ch; int val; char ch2; long len; MYENUM color; }; #pragma pack(0) int main() { printf("sizeof(struct pragma_struct_t)= %d\n", sizeof(struct pragma_struct_t)); return 0; } ------ How do I get this to work under g++ 3.2? Any patches or suggestions? -Milind From milindc@telesoftnet.com Wed Aug 4 16:52:00 2004 From: milindc@telesoftnet.com (Milind Changire) Date: Wed, 04 Aug 2004 16:52:00 -0000 Subject: __attribute__((packed)) behavior with gcc and g++ [gcc version 3.2 20020903] Message-ID: <1091634515.9797.49.camel@mitelLinux> Following peice of code compiles under gcc and reports the size of struct as 11, as expected. However g++ just does not like the code and reports an error 'semicolon missing after enum declaration' g++ 3.4.1 reports a 'warning: `packed' attribute ignored' and I get the size of struct as 14. I'd like to pack structures and cause enums to use mininum possible space, mostly a single byte, under gcc 3.2. Arch: i686 ------ #include #pragma pack(1) typedef enum { Red, Green, Blue } __attribute__((packed)) MYENUM; struct pragma_struct_t { char ch; int val; char ch2; long len; MYENUM color; }; #pragma pack(0) int main() { printf("sizeof(struct pragma_struct_t)= %d\n", sizeof(struct pragma_struct_t)); return 0; } ------ How do I get this to work under g++ 3.2? Any patches or suggestions? -Milind From pluto@pld-linux.org Wed Aug 4 18:52:00 2004 From: pluto@pld-linux.org (=?iso-8859-2?q?Pawe=B3_Sikora?=) Date: Wed, 04 Aug 2004 18:52:00 -0000 Subject: __attribute__((packed)) behavior with gcc and g++ [gcc version 3.2 20020903] In-Reply-To: <1091634515.9797.49.camel@mitelLinux> References: <1091634515.9797.49.camel@mitelLinux> Message-ID: <200408041758.36449.pluto@pld-linux.org> On Wednesday 04 of August 2004 17:48, Milind Changire wrote: > Any patches or suggestions? # g++ --version; g++ packed.cpp -o packed && ./packed g++ (GCC) 3.4.2 20040730 (prerelease) (PLD Linux) (...) sizeof(...)= 14 arch == pentium3. -- /* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */ #define say(x) lie(x) -------------- next part -------------- A non-text attachment was scrubbed... Name: packed.cpp Type: text/x-c++src Size: 466 bytes Desc: not available URL: From kkvamsi@yahoo.com Wed Aug 4 20:55:00 2004 From: kkvamsi@yahoo.com (vamsi KRISHNA) Date: Wed, 04 Aug 2004 20:55:00 -0000 Subject: error while installing gcc3.4.1 in compaq unix v5 Message-ID: <20040804165217.45109.qmail@web52707.mail.yahoo.com> hi, i am facing the following error while executing make command Configuring in libiberty configure: loading cache ./config.cache configure: error: `CFLAGS' has changed since the previous run: configure: former value: -O configure: current value: -g configure: error: changes in the environment can compromise the build configure: error: run `make distclean' and/or `rm ./config.cache' and start over *** Exit 1 Stop. what should i do to continue installing? bye vamsi __________________________________ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail From frostflare@bol.com.br Wed Aug 4 22:32:00 2004 From: frostflare@bol.com.br (frostflare) Date: Wed, 04 Aug 2004 22:32:00 -0000 Subject: Parse error Message-ID: I am using arm-elf-gcc to com?pile a C program, but it show this error: Decl_SON.h:46: error: parse error before "IRQHandler" And this is the lib Decl_SON.h that hhas the error: typedef struct { void (*TStart)(void); void *TStackLimit; unsigned long TStackPointer; char TName[10]; unsigned long TStackSize; unsigned short TSuspTics; } tcbstruc; extern unsigned long TIC; extern volatile unsigned long MainCounter; extern unsigned EXECUTIC; extern volatile unsigned PROTECT; extern volatile int CurrentTask; extern unsigned MainTask; extern tcbstruc TCB[]; extern tcbstruc* CurrentTaskPointer; void __irq IRQHandler(void); void SaveAndRestore(tcbstruc* SaveTask,tcbstruc* RestoreTask); void InitialiseContext(tcbstruc* tcb); void InitialiseTasks(void); void Suspend(unsigned SuspTics, unsigned long StartTic); void GPISR(void); Can somebody help me with this? Thankyou Wellington Brazil __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mcgehan@boulder.nist.gov Wed Aug 4 22:37:00 2004 From: mcgehan@boulder.nist.gov (mcgehan@boulder.nist.gov) Date: Wed, 04 Aug 2004 22:37:00 -0000 Subject: Retired! Message-ID: <200408042055.i74Kt3t13270@franklin.boulder.nist.gov> I have retired from federal service as of February 3, 2004. If you need assistance, please contact Mary Brunner at brunner@boulder.nist.gov From zhuw@ucla.edu Wed Aug 4 23:25:00 2004 From: zhuw@ucla.edu (Weijun Zhu) Date: Wed, 04 Aug 2004 23:25:00 -0000 Subject: undefined reference to ___gxx_personality_v0 Message-ID: <41116421.2000608@ucla.edu> Hello, I have a library compiled by g++ version 3.2 and have no problem link against it using g++ 3.2. But when I was linking against it using g++ 2.96 or g++ 3.3.1, I got the following error: undefined reference to ___gxx_personality_v0? Do I have to use the same g++ version as the library to link against it? Thanks, Weijun. From hueffner@informatik.uni-tuebingen.de Thu Aug 5 05:45:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Thu, 05 Aug 2004 05:45:00 -0000 Subject: undefined reference to ___gxx_personality_v0 In-Reply-To: <41116421.2000608@ucla.edu> (Weijun Zhu's message of "Wed, 04 Aug 2004 15:33:05 -0700") References: <41116421.2000608@ucla.edu> Message-ID: <87wu0esf7e.fsf@informatik.uni-tuebingen.de> Weijun Zhu writes: > I have a library compiled by g++ version 3.2 and have no problem link > against it using > g++ 3.2. But when I was linking against it using g++ 2.96 or g++ > 3.3.1, I got the following > error: > undefined reference to ___gxx_personality_v0? > > Do I have to use the same g++ version as the library to link against it? Yes. -- Falk From zhuw@ucla.edu Thu Aug 5 08:05:00 2004 From: zhuw@ucla.edu (Weijun Zhu) Date: Thu, 05 Aug 2004 08:05:00 -0000 Subject: undefined reference to ___gxx_personality_v0 In-Reply-To: <87wu0esf7e.fsf@informatik.uni-tuebingen.de> References: <41116421.2000608@ucla.edu> <87wu0esf7e.fsf@informatik.uni-tuebingen.de> Message-ID: <41117094.8000203@ucla.edu> Thanks! is there a way to compile the library such that it could be used on different versions of gcc? Weijun. Falk Hueffner wrote: >Weijun Zhu writes: > > > >>I have a library compiled by g++ version 3.2 and have no problem link >>against it using >>g++ 3.2. But when I was linking against it using g++ 2.96 or g++ >>3.3.1, I got the following >>error: >>undefined reference to ___gxx_personality_v0? >> >>Do I have to use the same g++ version as the library to link against it? >> >> > >Yes. > > > From alexvn@connect.to Thu Aug 5 10:42:00 2004 From: alexvn@connect.to (Alex Vinokur) Date: Thu, 05 Aug 2004 10:42:00 -0000 Subject: gcc: speed problem with several g++ versions References: <410E3788.1080806@math.tu-dresden.de> <87657zi7x7.fsf@informatik.uni-tuebingen.de> Message-ID: "Alex Vinokur" wrote in message news:ceq9t0$5d5$1@sea.gmane.org... > > "Falk Hueffner" wrote in message news:87657zi7x7.fsf@informatik.uni-tuebingen.de... > [snip] > > This seems to be something target specific; > [snip] > > Yes, performance of the same compiler on different targets is quite different. > See, for instance: > http://article.gmane.org/gmane.comp.lang.c%2B%2B.perfometer/37 > http://groups.google.com/groups?selm=biihim%249opf4%241%40ID-79865.news.uni-berlin.de > [snip] Also http://groups.google.com/groups?threadm=bjosu1%24lk214%241%40ID-79865.news.uni-berlin.de -- Alex Vinokur http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn From hueffner@informatik.uni-tuebingen.de Thu Aug 5 12:17:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Thu, 05 Aug 2004 12:17:00 -0000 Subject: undefined reference to ___gxx_personality_v0 In-Reply-To: <41117094.8000203@ucla.edu> (Weijun Zhu's message of "Wed, 04 Aug 2004 16:26:12 -0700") References: <41116421.2000608@ucla.edu> <87wu0esf7e.fsf@informatik.uni-tuebingen.de> <41117094.8000203@ucla.edu> Message-ID: <87d6266nm0.fsf@informatik.uni-tuebingen.de> Weijun Zhu writes: > Thanks! is there a way to compile the library such that it could be > used on different versions of gcc? No. >>>I have a library compiled by g++ version 3.2 and have no problem link >>>against it using >>>g++ 3.2. But when I was linking against it using g++ 2.96 or g++ >>>3.3.1, I got the following >>>error: >>>undefined reference to ___gxx_personality_v0? >>> >>>Do I have to use the same g++ version as the library to link against it? >> >>Yes. -- Falk From squareroot2@freemail.hu Thu Aug 5 15:11:00 2004 From: squareroot2@freemail.hu (Demeter =?ISO-8859-1?Q?=C1kos?=) Date: Thu, 05 Aug 2004 15:11:00 -0000 Subject: -mcpu vs -march Message-ID: <1091702519.5845.3.camel@nest> Hello! I searched the man to find that if for gcc multiple -O options are given then the last one will be used. for example: gcc -O3 -O2 is the same as gcc -O2 but I was searching for the -march and -mcpu. If both is given like: gcc -march=pentium3 -mcpu=pentium3 then what will it be? I found that -march implies -mcpu (like -O3 implies -O2) so I thought that then -mcpu will be used, but so said no. Some said, no matter the order of the two flags mcpu will be used. So I got confused. Thanks for your help! ps.: I'm not signed onto this mailinglist, so if you be so kind to CC the answer to my address as well. -- Demeter ?kos -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From eljay@adobe.com Thu Aug 5 17:12:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 05 Aug 2004 17:12:00 -0000 Subject: undefined reference to ___gxx_personality_v0 References: <41116421.2000608@ucla.edu> <87wu0esf7e.fsf@informatik.uni-tuebingen.de> <41117094.8000203@ucla.edu> Message-ID: <00ec01c47ae5$ef809f60$07b2f882@PS253> Hi Weijun, >is there a way to compile the library such that it could be used on different versions of gcc? Yes: compile the library with that different version of gcc. HTH, --Eljay From otto.wyss@orpatec.ch Thu Aug 5 17:32:00 2004 From: otto.wyss@orpatec.ch (Otto Wyss) Date: Thu, 05 Aug 2004 17:32:00 -0000 Subject: Gcc calls Id with unrecognized option '--as-needed' Message-ID: <41124E02.A55F0550@orpatec.ch> The configure of the wxWidgets package tests for gcc with a simple test app but during this test ld stops with error unrecognized option '--as-needed' (see log). ============================================ configure:9121: checking whether the C compiler (gcc ) works configure:9137: gcc -o conftest conftest.c 1>&5 /usr/bin/ld: unrecognized option '--as-needed' /usr/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status configure: failed program was: #line 9132 "configure" #include "confdefs.h" main(){return(0);} ============================================ Does anyone know why gcc calls ld with this option and how I could correct it? I use Debian/sarge with gcc -dumpversion 3.3.4 ld -V GNU ld version 2.14.90.0.7 20031029 Debian GNU/Linux O. Wyss -- See a huge pile of work at "http://wyodesktop.sourceforge.net/" From Claudio.Lavecchia@eurecom.fr Thu Aug 5 17:36:00 2004 From: Claudio.Lavecchia@eurecom.fr (Claudio Lavecchia) Date: Thu, 05 Aug 2004 17:36:00 -0000 Subject: Using signals in redhat linux Message-ID: <41126A76.60802@eurecom.fr> Hello people, I have a quick question about using signals in Linux environment - redhat 7.3. I'm using GCC version 2.96. I'm trying to launch and intercept signals - but the signals never get intercepted. Any of you guys have an idea of why? Do I have to set any compile option? I include the very simple test (using both alarm() and raise() to send signals) Thanks a lot Claudio #include #include #include void processAlarm() { signal(SIGALRM, processAlarm); printf("ALARM INTERCEPTED"); alarm(3); } void processSIG() { signal(100, processSIG); printf("SIG INTERCEPTED"); } int main(int argc, char *argv[]) { printf("Launching Alarm Test\n"); signal(SIGALRM, processAlarm); printf("Launching Alarm (previous alarm value: %d)\n",alarm(3)); printf("Alarm value:%d\n",alarm(0)); signal(100, processSIG); raise(100); while (1); return 0; } From ishwar@pali.cps.cmich.edu Thu Aug 5 18:16:00 2004 From: ishwar@pali.cps.cmich.edu (Ishwar Rattan) Date: Thu, 05 Aug 2004 18:16:00 -0000 Subject: Using signals in redhat linux In-Reply-To: <41126A76.60802@eurecom.fr> References: <41126A76.60802@eurecom.fr> Message-ID: Did your code work on any other system? Learn nature of signals and related calls first! -ishwar On Thu, 5 Aug 2004, Claudio Lavecchia wrote: > Hello people, > > I have a quick question about using signals in Linux environment - > redhat 7.3. > I'm using GCC version 2.96. > I'm trying to launch and intercept signals - but the signals never get > intercepted. > > Any of you guys have an idea of why? Do I have to set any compile option? > > I include the very simple test (using both alarm() and raise() to send > signals) > > Thanks a lot > > Claudio > > #include > #include > #include > > > void processAlarm() > { > signal(SIGALRM, processAlarm); > printf("ALARM INTERCEPTED"); > alarm(3); > } > > void processSIG() > { > signal(100, processSIG); > printf("SIG INTERCEPTED"); > } > > int main(int argc, char *argv[]) > { > printf("Launching Alarm Test\n"); > signal(SIGALRM, processAlarm); > > printf("Launching Alarm (previous alarm value: %d)\n",alarm(3)); > printf("Alarm value:%d\n",alarm(0)); > > signal(100, processSIG); > raise(100); > > while (1); > return 0; > } > From eljay@adobe.com Thu Aug 5 18:33:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 05 Aug 2004 18:33:00 -0000 Subject: Using signals in redhat linux References: <41126A76.60802@eurecom.fr> Message-ID: <01f701c47b12$8bd13d30$07b2f882@PS253> Hi Claudio, Your question is off-topic for this forum. This forum does not support Red Hat's 2.96 compiler (Red Hat has a forum for support of their compiler). This forum does not support Red Hat Linux 7.3 (Red Hat has support forums for that OS, including for developers). That being said... What are you NOT allowed to do within a signal? Depending on the platform, there are MANY caveats about what you can and cannot do within a signal handler. Typically: + no I/O (such as a printf) + no OS API calls* + in C++ land, no exceptions + no longjmp + no read/writing non-volatile variables + no exit / abort * The "no I/O" falls under this category, but it's so important I put it all by itself anyway. What should a signal handler do? As little as possible, as quickly as possible. Set a flag, and then have the regular program check that (volatile) flag for being changed. (I'm not sure about mutexes and condvars within signal handlers... probably another concern.) In a multi-threading program, I'm not sure if there is any guarantee which thread will be handling the signal. Probably varies from platform to platform. I'm not sure if any of the above is applicable to Red Hat Linux 7.3, or Red Hat 2.96 compiler. I'm not sure if there is a attribute decoration for the signal handling function in your situation (as I vaguely recall from my Borland Turbo C days). HTH, --Eljay From klindsay@sxip.com Thu Aug 5 18:44:00 2004 From: klindsay@sxip.com (Kevin Lindsay) Date: Thu, 05 Aug 2004 18:44:00 -0000 Subject: Statically Linked Shared Objects Message-ID: <4112797E.2040700@sxip.com> Hi, I am creating a statically linked shared object which I want to link to on different systems. The problem here is that this library is binary incompatible with the application that will be loading it, thus friendly segfaults appear. Specifically, glibc 2.3.2 symbols exist in this static library. I want an application compiled with glibc 2.2.5 to load it without symbol conflicts. This is what I have done so far: libA.so - Statically linked shared object using glibc 2.3.2. Module.so - Perl C module built with glibc-2.2.5 which links to libA.so. Perl, which is also using glibc-2.2.5 dynamically loads Module.so, a few system calls after dlopen() a segfault occurs. Any help is appreciated, thanks. Kevin- From silverbirdinternational@fastermail.com Thu Aug 5 23:40:00 2004 From: silverbirdinternational@fastermail.com (BEN BRUCE) Date: Thu, 05 Aug 2004 23:40:00 -0000 Subject: BEAUTY PAGENT DEAL. Message-ID: THIS IS TO INFORM YOU ABOUT A BUSINESS DEAL. A BEAUTY PAGENT WOULD BE HOLDING, WHICH WOULD ATTRACT THE SUM OF $1,000,000 US DOLLARS AND WOULD BE EXECUTED WITH THE SUM OF $500,000 US DOLLARS.THE PAGENT WOULD ATTRACT A MINIMUM OF 30% PERCENT INTREST TO YOU IF YOU CAN DONATE THE SUM OF $150,000 US DOLLARS .IF YOU ARE INTRESTED IN THE DEAL YOU CAN MAIL ME BACK. THANKS BEN BRUCE (CEO)SILVERBIRD INTERNATIONAL. From kalyan_ch@students.iiit.net Fri Aug 6 06:39:00 2004 From: kalyan_ch@students.iiit.net (EMPEROR) Date: Fri, 06 Aug 2004 06:39:00 -0000 Subject: gcc for unix system Message-ID: hi, I am trying to install gcc on a unix system.I dont know my processor so i cant specify host for configuring. but ./configure alone, i think is not working. First of all is gcc compatible with unix system. if yes can u kindly describe what i should do inorder to intall -- Do u know that a simple "hello" can be a sweet one? The word HELLO means: H = How r u ? E = Everythig all right ? L = Like to hear from u L = Love to see u O = Obviously, I miss u So HELLO :) From silverbirdinternational@fastermail.com Fri Aug 6 09:13:00 2004 From: silverbirdinternational@fastermail.com (BEN BRUCE) Date: Fri, 06 Aug 2004 09:13:00 -0000 Subject: BEAUTY PAGENT DEAL. Message-ID: THIS IS TO INFORM YOU ABOUT A BUSINESS DEAL. A BEAUTY PAGENT WOULD BE HOLDING, WHICH WOULD ATTRACT THE SUM OF $1,000,000 US DOLLARS AND WOULD BE EXECUTED WITH THE SUM OF $500,000 US DOLLARS.THE PAGENT WOULD ATTRACT A MINIMUM OF 30% PERCENT INTREST TO YOU IF YOU CAN DONATE THE SUM OF $150,000 US DOLLARS .IF YOU ARE INTRESTED IN THE DEAL YOU CAN MAIL ME BACK. THANKS BEN BRUCE (CEO)SILVERBIRD INTERNATIONAL. From john.carter@tait.co.nz Fri Aug 6 09:32:00 2004 From: john.carter@tait.co.nz (John Carter) Date: Fri, 06 Aug 2004 09:32:00 -0000 Subject: Carter's Merry Magic Link Time Registration of Callbacks. Message-ID: Here is an evil trick for you.... So we have a conundrum. We want... a) A true layered architecture. b) We want to be able to build and run each layer by itself. c) We trying to trim startup time, so run time registration is not preferred. d) We want the information relating to each layer to be in the correct module. e) This is embedded system, so we prefer fixed sizes to unbounded heap structures. Taraa! Enter Carter's Magical Mystical Link Time Callback Registration technique. (Thanks to JohnW for the suggestion of misusing "weak") At the bottom most layer we have a header file.... ==lower.h============================================================= #ifndef _LOWER_H #ifdef __GNUC__ #define WEAK __attribute__ ((weak)) #else #error This code is non-portable. #endif // Save parameter and notify all subscribers if new value is different // from the old value. void save( int); #endif ====================================================================== Note evil non-portable bit. However, don't sulk too badly, it probably isn't too difficult to port or to convert to run time registration again. ====lower.c=========================================================== #include #include "lower.h" typedef void callback_t(int); // Do nothing on callback. static void dummy(int i __attribute__ ((unused))) {} // Just tell linker all unused slots are dummy void __attribute__ ((weak,alias("dummy"))) slot_1(int); void __attribute__ ((weak,alias("dummy"))) slot_2(int); void __attribute__ ((weak,alias("dummy"))) slot_3(int); void __attribute__ ((weak,alias("dummy"))) slot_4(int); void __attribute__ ((weak,alias("dummy"))) slot_5(int); #define numSlots 5 static callback_t * const slots[numSlots] = {slot_1,slot_2,slot_3,slot_4,slot_5}; void save(int data) { static int data_store; if( data != data_store) { data_store = data; int i; for( i=0; i < numSlots; ++i) { (*(slots[i]))(data_store); } } } int WEAK main() { save(10); save(10); save(20); save(20); save(10); return 0; } ====================================================================== Here we have a fixed number of slots, packed with the address of dummy routines. Ooh. Looky it has it's own "main" routine. We can compile, link and run it like so... cc -Wall -W -O3 -c -o lower.o lower.c cc lower.o -o lower Run lower by itself lower Yip, it ran OK. So add one higher layer.... ==higher_a.h========================================================== #ifndef _HIGHER_A_H void hit_a(int); #endif ==higher_a.c========================================================== #include #include "lower.h" #include "higher_a.h" void slot_4(int i) { printf( "Module A has just been told that the new value is %d\n", i); } void hit_a(int value) { printf( "Hit A with a %d\n", value); save( value); } int WEAK main() { hit_a(-1); hit_a(1); hit_a(1); hit_a(2); return 0; } ====================================================================== This one uses slot_4 and ooh looky, it _also_ has a main. So we can compile, link and run it like so... cc -Wall -W -O3 -c -o higher_a.o higher_a.c cc higher_a.o lower.o -o higher_a Run higher_a by itself higher_a Hit A with a -1 Module A has just been told that the new value is -1 Hit A with a 1 Module A has just been told that the new value is 1 Hit A with a 1 Hit A with a 2 Module A has just been told that the new value is 2 Ooh Looky! We get a call back whenever the data store has changed. Note we didn't change a _single_ byte of lower.c or lower.h to create higher_a! We must be doing something right! But what about a peer for higher_a? Does that stuff things up? =higher_b.h=========================================================== #ifndef _HIGHER_B_H void hit_b(int); #endif =higher_b.c=========================================================== #include #include "lower.h" #include "higher_b.h" void slot_2(int i) { printf( "Module B has just been told that the new value is %d\n", i); } void hit_b(int value) { printf( "Hit B with a %d\n", value); save( value); } int WEAK main() { hit_b(-1); hit_b(1); hit_b(1); hit_b(2); return 0; } ====================================================================== This is just a proof of concept so higher_b is just the same as higher_a except I have used slot_2 this time. In reality is would be an entirely different module. cc -Wall -W -O3 -c -o higher_b.o higher_b.c cc higher_b.o lower.o -o higher_b Run higher_b by itself higher_b Hit B with a -1 Module B has just been told that the new value is -1 Hit B with a 1 Module B has just been told that the new value is 1 Hit B with a 1 Hit B with a 2 Module B has just been told that the new value is 2 Great, not a byte of lower.c, lower.h or higher_a.c change to create higher_b. We must be doing something right! So can we have a super layer? =====top_layer.c====================================================== #include "higher_a.h" #include "higher_b.h" int main() { hit_a(10); hit_b(30); hit_a(30); return 0; } ====================================================================== Compile and link it... cc -Wall -W -O3 -c -o top_layer.o top_layer.c cc top_layer.o higher_a.o higher_b.o lower.o -o top_layer That was easy. We didn't change a single bit of lower.c, lower.h, higher_a.h, higher_b.h, higher_a.c, or higher_b.c We _really_ must be doing something right. So let's run it and see if it works... top_layer Hit A with a 10 Module B has just been told that the new value is 10 Module A has just been told that the new value is 10 Hit B with a 30 Module B has just been told that the new value is 30 Module A has just been told that the new value is 30 Hit A with a 30 Yup, it all just works! And here is the Makefile.. ==Makefile============================================================ CFLAGS = -Wall -W -O3 all : lower higher_a higher_b top_layer @echo Run lower by itself lower @echo Run higher_a by itself higher_a @echo Run higher_b by itself higher_b @echo Run toplayer top_layer lower : lower.o lower.o : lower.c lower.h higher_a : higher_a.o lower.o higher_a.o : higher_a.c lower.h higher_b : higher_b.o lower.o higher_b.o : higher_b.c lower.h top_layer.o : top_layer.c lower.h top_layer : top_layer.o higher_a.o higher_b.o lower.o .PHONY : clean clean : -rm -v *.o lower higher_a higher_b top_layer ====================================================================== John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand The universe is absolutely plastered with the dashed lines exactly one space long. From thl@dev.de.cw.com Fri Aug 6 18:39:00 2004 From: thl@dev.de.cw.com (Thomas Lotterer) Date: Fri, 06 Aug 2004 18:39:00 -0000 Subject: Gcc calls Id with unrecognized option '--as-needed' In-Reply-To: <41124E02.A55F0550@orpatec.ch> References: <41124E02.A55F0550@orpatec.ch> Message-ID: <20040806091338.GC33746@dev.de.cw.com> On Thu, Aug 05, 2004, Otto Wyss wrote: > The configure of the wxWidgets package tests for gcc with a simple > test app but during this test ld stops with error unrecognized option > '--as-needed' (see log) [...] > > Does anyone know why gcc calls ld with this option and how I could > correct it? > http://cvs.openpkg.org/chngview?cn=16830 reads: Accept (and ignore) --as-needed/--no-as-needed options from GNU binutils 2.15 in our GNU binutils 2.14 to resolve a chicken and egg problem under platforms (like Fedora Core 2) which already run GNU binutils 2.15: the vendor cc(1) knows that it has ld(1) from GNU binutils 2.15 and hence always uses the --as-needed option when calling ld(1). Unfortunately, between having built "binutils" and "gcc" packages, this will break OpenPKG because the vendor cc(1) would run the OpenPKG ld(1) with an option it (still) does not understand. The only workaround is to let our ld(1) accept and ignore this option. Once our cc(1) from "gcc" package is installed, the problem is gone, because our "gcc" package correctly detects that our ld(1) still does ot understand --as-needed. -- Thomas.Lotterer@cw.com, Cable & Wireless From thl@dev.de.cw.com Fri Aug 6 19:19:00 2004 From: thl@dev.de.cw.com (Thomas Lotterer) Date: Fri, 06 Aug 2004 19:19:00 -0000 Subject: gcc for unix system In-Reply-To: References: Message-ID: <20040806093237.GD33746@dev.de.cw.com> On Fri, Aug 06, 2004, EMPEROR wrote: > I am trying to install gcc on a unix system.I dont know > my processor [...] > Try OpenPKG [1] from source, it'll find out. You need the bootstrap package, make, binutils and gcc. Have a look at the tutorial [2] or give it a dry run viewing the showcase [3] (animated GIF). You can even build and install OpenPKG as unprivileged user. If the build fails at least you'll get GNU shtool 2.0 with the download. It'll help you even if you decide not to go the OpenPKG route. It is available from OSSP [4]. Find out which arch-os (used to name OpenPKG binary RPMs) $ shtool platform -t binary Find CPU/system architecture/product/technology in human readable format $ shtool platform -t all-in-one [1] http://www.openpkg.org/ [2] http://www.openpkg.org/tutorial.html [3] http://www.openpkg.org/showcase.html [4] http://www.ossp.org/pkg/tool/shtool/ -- Thomas.Lotterer@cw.com, Cable & Wireless From zhuw@ucla.edu Fri Aug 6 19:27:00 2004 From: zhuw@ucla.edu (Weijun Zhu) Date: Fri, 06 Aug 2004 19:27:00 -0000 Subject: remove unused symbol and function Message-ID: <4113D06A.1040801@ucla.edu> Hello, A function (say foo1) in an object file calls a library function (say foo2). The library does not exist on the system. foo1 is not called in the target that I am building. But the GCC gives me an error that undefined reference to foo2 while linking? Is there a way to avoid linking unused symbols? Weijun. From eljay@adobe.com Fri Aug 6 20:21:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 06 Aug 2004 20:21:00 -0000 Subject: remove unused symbol and function References: <4113D06A.1040801@ucla.edu> Message-ID: <00cd01c47bea$3c7ac8e0$75b2f882@PS253> Hi Weijun, You could try -ffunction-sections, -fdata-sections, and -gc-sections (garbage collect unused sections). May or may not work, and could be platform dependent as to how well they work. You're better off not including the unused foo1 which depends on unresolveable foo2 in the first place. Another hack would be to define a (spoofed and also unused) foo2. That'd make foo1 happy. HTH, --Eljay "Don't anthropomorphize computers. They hate it when you do that." From bvds@bvds.geneva.edu Fri Aug 6 20:43:00 2004 From: bvds@bvds.geneva.edu (bvds@bvds.geneva.edu) Date: Fri, 06 Aug 2004 20:43:00 -0000 Subject: g77 and valgrind error? Message-ID: <200408061927.i76JRqik014917@bvds.geneva.edu> I am using valgrind on a g77 program and am getting some peculiar results: Cccccccccccccccccccccccccccccccccccccccccc program memty integer i i=360 call fsub(i) end C subroutine fsub(i) integer i double complex x(i,i) x(i,i)=complex(0D0,0D0) end Ccccccccccccccccccccccccccccccccccccccccc Valgrind gives an error of the form: ==12420== Invalid write of size 8 ==12420== at 0x8048671: fsub_ (memty.f:10) ==12420== by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61) ==12420== Address 0x52BFE8A0 is on thread 1's stack ==12420== ==12420== Invalid write of size 8 ==12420== at 0x8048679: fsub_ (memty.f:10) ==12420== by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61) ==12420== Address 0x52BFE8A8 is on thread 1's stack Some more info: bvds> uname -a Linux bvds 2.4.25 #1 SMP Sat Mar 20 15:34:02 EST 2004 i686 i686 i386 GNU/Linux bvds> g77 --version GNU Fortran (GCC) 3.3.2 bvds> valgrind --version valgrind-2.1.2 I see the same behavior in valgrind-2.0.0. This only happens for complex arrays. if I use the g77 flag -femulate-complex, then there is one error. (I have also sent this to the valgrind mailing list.) Any ideas? Brett van de Sande From toon@moene.indiv.nluug.nl Fri Aug 6 20:57:00 2004 From: toon@moene.indiv.nluug.nl (Toon Moene) Date: Fri, 06 Aug 2004 20:57:00 -0000 Subject: Anyone knowlegable about valgrind ? Was: Re: g77 and valgrind error? In-Reply-To: <200408061927.i76JRqik014917@bvds.geneva.edu> References: <200408061927.i76JRqik014917@bvds.geneva.edu> Message-ID: <4113E9B8.3070501@moene.indiv.nluug.nl> bvds@bvds.geneva.edu wrote: > I am using valgrind on a g77 program and am getting > some peculiar results: > > Cccccccccccccccccccccccccccccccccccccccccc > program memty > integer i > i=360 > call fsub(i) > end > C > subroutine fsub(i) > integer i > double complex x(i,i) > x(i,i)=complex(0D0,0D0) > end > Ccccccccccccccccccccccccccccccccccccccccc > > Valgrind gives an error of the form: I do not know anything about valgrind, but the Fortran code is perfectly OK. It uses an automatic array x in subroutine fsub that is dimensioned using the dummy argument i, which is an extension of Fortran 77, but allowed in Fortran 90 and supported by g77. I tried your code using g77-3.3.4 as supplied by Debian on their testing platform (up-to-date as of Sunday 1/8/2004) and it performs perfectly. I'm afraid someone else has to help you here (that's why I changed the subject). Cheers, -- Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/ From bvds@bvds.geneva.edu Fri Aug 6 22:35:00 2004 From: bvds@bvds.geneva.edu (bvds@bvds.geneva.edu) Date: Fri, 06 Aug 2004 22:35:00 -0000 Subject: Anyone knowlegable about valgrind ? Was: Re: g77 and valgrind error? In-Reply-To: <4113E9B8.3070501@moene.indiv.nluug.nl> (message from Toon Moene on Fri, 06 Aug 2004 22:27:36 +0200) References: <200408061927.i76JRqik014917@bvds.geneva.edu> <4113E9B8.3070501@moene.indiv.nluug.nl> Message-ID: <200408062043.i76KhNcG004458@bvds.geneva.edu> > >I do not know anything about valgrind, but the Fortran code is perfectly >OK. It uses an automatic array x in subroutine fsub that is dimensioned >using the dummy argument i, which is an extension of Fortran 77, but >allowed in Fortran 90 and supported by g77. Yes, the code itself is OK... Another detail that I forgot to mention is that the valgrind error goes away when i=350. Is there anything about memory allocation in g77 that would change with increasing i? I have also put this question to the valgrind people, but *they* probably don't know much about g77. BvdS From toon@moene.indiv.nluug.nl Fri Aug 6 22:40:00 2004 From: toon@moene.indiv.nluug.nl (Toon Moene) Date: Fri, 06 Aug 2004 22:40:00 -0000 Subject: Anyone knowlegable about valgrind ? Was: Re: g77 and valgrind error? In-Reply-To: <200408062043.i76KhNcG004458@bvds.geneva.edu> References: <200408061927.i76JRqik014917@bvds.geneva.edu> <4113E9B8.3070501@moene.indiv.nluug.nl> <200408062043.i76KhNcG004458@bvds.geneva.edu> Message-ID: <4113F240.30207@moene.indiv.nluug.nl> bvds@bvds.geneva.edu wrote: >>I do not know anything about valgrind, but the Fortran code is perfectly >>OK. It uses an automatic array x in subroutine fsub that is dimensioned >>using the dummy argument i, which is an extension of Fortran 77, but >>allowed in Fortran 90 and supported by g77. > > Yes, the code itself is OK... > Another detail that I forgot to mention is that the valgrind > error goes away when i=350. Is there anything about memory > allocation in g77 that would change with increasing i? > > I have also put this question to the valgrind people, but > *they* probably don't know much about g77. I wouldn't know why 360 is a "magic number", but g77 doesn't do anything but place the automatic array on the stack. Therefore, we have to deal with 16 * 360 * 360 bytes = slightly over 2 megabytes of stack space. I can't see why this would be a problem (unless other automatic arrays are also dimensioned using `i'. Cheers, -- Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/ From adrianb@cs.cmu.edu Sat Aug 7 04:26:00 2004 From: adrianb@cs.cmu.edu (Adrian Broadhurst) Date: Sat, 07 Aug 2004 04:26:00 -0000 Subject: erratic typeinfo problem on mac (gcc 3.3) Message-ID: Hi I am having problems with gcc version 3.3 (and 3.1) on OS X 10.2.8 This problem is not easily repeatable. When I compile with -O0 and -g, the compiler is not instantiating all the typeinfo needed to link the project. This problem does not occur on i686 platforms. The error occurs in about 1 of 100 modules, but the affected module changes erratically. The project is linked indirectly using 'ar' archive tool. .cc -> .o -> libLibrary.a -> executable. I have not been able to reproduce this problem in a small scale project. I can sometimes get the program to link by linking the effected modules twice (once with -O3 and once with -O0). Is this a known problem? Adrian From rradford@mindspring.com Sat Aug 7 11:43:00 2004 From: rradford@mindspring.com (Rodney Radford) Date: Sat, 07 Aug 2004 11:43:00 -0000 Subject: Problem with GCC 3.4 vs 3.3 and packed structs Message-ID: <27625254.1091831996772.JavaMail.root@wamui10.slb.atl.earthlink.net> The following code snippet works as expected in GCC 3.3.3 (both i686 and x86_64 platforms), but fails with a compile error on GCC 3.4: #define PACKED __attribute__ ((packed)) struct three { char larry; char curly; char moe; } PACKED *stooges; char & knucklehead(void) { return stooges->moe; } The compile error is: packed.c: In function `char& knucklehead()': packed.c:12: error: cannot bind packed field `stooges->three::moe' to `char&' I searched through the GCC message archives and did run across a series of messages that state that fields in packed structures are now treated as if they are bitfields and taking the address of (or reference of) the fields is not supported. Unfortunately, our application relies heavily on packed structures and uses the above construct frequently. I have tried moving the PACKED attribute to the individual fields, or after "three", as well as applying it to the referenc of knucklehead, but all to no avail. Is there any work around - either via a compiler option, or a change to our source code (other than removing the packed attribute) that you can recommend? Similarly, I read through the information in the GCC 3.4.1 manual on the use of the packed attribute and tried the following sequence of code taken straight from the manual: struct my_unpacked_struct { char c; int i; }; struct my_packed_struct __attribute__ ((__packed__)) { char c; int i; struct my_unpacked_struct s; }; This code also fails to compile, but with a different message: packed.c:9: error: expected unqualified-id before '{' token packed.c:9: error: expected `,' or `;' before '{' token Any assistance, or advice, is greatly appreciated. Thanx. PS: This email address is protected via Earthlink's spamBlocker, so any sender will receive an email message pointing them to a webpage where they must first request to be added to my approved list before the email can be delivered. I check the 'spam folder' regularly, but occasionally miss a real message, so I apologize for the inconvenience, but I request that you please follow through the simple steps to make sure the email is sent on to me. From jaf@lcsaudio.com Sat Aug 7 13:07:00 2004 From: jaf@lcsaudio.com (Jeremy Friesner) Date: Sat, 07 Aug 2004 13:07:00 -0000 Subject: subscribe jaf@lcsaudio.com Message-ID: <200408062125.28317.jaf@lcsaudio.com> subscribe jaf@lcsaudio.com From bvds@bvds.geneva.edu Sun Aug 8 17:49:00 2004 From: bvds@bvds.geneva.edu (bvds@bvds.geneva.edu) Date: Sun, 08 Aug 2004 17:49:00 -0000 Subject: Anyone knowlegable about valgrind ? Was: Re: g77 and valgrind error? In-Reply-To: <4113F240.30207@moene.indiv.nluug.nl> (message from Toon Moene on Fri, 06 Aug 2004 23:04:00 +0200) References: <200408061927.i76JRqik014917@bvds.geneva.edu> <4113E9B8.3070501@moene.indiv.nluug.nl> <200408062043.i76KhNcG004458@bvds.geneva.edu> <4113F240.30207@moene.indiv.nluug.nl> Message-ID: <200408071143.i77Bhnmq005332@bvds.geneva.edu> >> >> ==12420== Invalid write of size 8 >> ==12420== at 0x8048671: fsub_ (memty.f:10) >> ==12420== by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61) >> ==12420== Address 0x52BFE8A0 is on thread 1's stack >> ==12420== >> ==12420== Invalid write of size 8 >> ==12420== at 0x8048679: fsub_ (memty.f:10) >> ==12420== by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61) >> ==12420== Address 0x52BFE8A8 is on thread 1's stack > >If you run with -v you will see this warning: > >==9495== Warning: thread 1 switching stacks? %esp: 0x52BFEA10 --> 0x52A04610 > >What's happening is that the very large array is using about 1Mb of >stack space and that is confusing valgrind into thinking that the >thread has switched to a different stack so it doesn't mark all that >space as writable and then you get invalid write warnings. > >Tom > >-- >Tom Hughes (thh@cyberscience.com) >Software Engineer, Cyberscience Corporation >http://www.cyberscience.com/ > Here is the reply from one of the valgrind people, which clears things up a bit. It is interesting that this *only* happens for type complex. Thanks, Brett van de Sande From bilha.sandak@weizmann.ac.il Mon Aug 9 04:03:00 2004 From: bilha.sandak@weizmann.ac.il (Bilha Sandak) Date: Mon, 09 Aug 2004 04:03:00 -0000 Subject: inquiry Message-ID: <200408071307.QAA8603328@bina.wisdom.weizmann.ac.il> Dear All, I wish to install a stable running version of gcc (Fortran,c,c++) on a PC/Linux machine (Intel Pentium-4 2.8GHz with 2GB memory and 200GB disk-space). I will be much obliged to you for instructing me on the fastest, safest and self-contained way of doing so. I thank you. Sincerely, Dr. B. Sandak From ranko@spidernet.net Mon Aug 9 11:20:00 2004 From: ranko@spidernet.net (Ranko Zivojnovic) Date: Mon, 09 Aug 2004 11:20:00 -0000 Subject: Warnings with __builtin_choose_expr & __builtin_types_compatible_p Message-ID: <1091987259.1104.56.camel@zranko.spidernet.com.cy> Greetings, I'm not sure if I'm missing something: when I try to compile the below test case I get: [ranko@ranko-home tmp]% gcc -o test-case test-case.c test-case.c: In function `main': test-case.c:40: warning: passing arg 1 of `example_func2' from incompatible pointer type test-case.c:41: warning: passing arg 1 of `example_func1' from incompatible pointer type The code is correct and the correct functions do get executed. I would like however to get rid of the false warnings during the compilation. [ranko@ranko-home tmp]% ./test-case in example_func1() test: 0 in example_func2() ts: 30 Thanks and best regards, Ranko [ranko@ranko-home tmp]% gcc -v Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) /* test-case.c */ #include #include typedef struct example { int t1; int t2; int t3; int t4; } example_t; unsigned long long example_func1(unsigned long *ulp) { printf("in example_func1()\n"); return (0 + *ulp); } unsigned long long example_func2(example_t *tp) { printf("in example_func2()\n"); return (unsigned long long)(tp->t1 + tp->t2 + tp->t3 + tp->t4); } #define example_def(x) \ __builtin_choose_expr( \ __builtin_types_compatible_p(typeof (x), unsigned long), \ example_func1(&(x)), \ __builtin_choose_expr( \ __builtin_types_compatible_p (typeof (x), example_t), \ example_func2(&(x)), abort())) static unsigned long test = 0; static example_t ts = { 2, 4, 8, 16 }; int main(int argc, char *argv[]) { printf("test: %llu\n", example_def(test)); printf("ts: %llu\n", example_def(ts)); return 0; } -- Ranko Zivojnovic, IT Director/CTO ranko@spidernet.net Spidernet Services Ltd., Tel: +357 22 844844 Nicosia, Cyprus FAX: +357 22 669470 From linux@rochester.rr.com Mon Aug 9 12:06:00 2004 From: linux@rochester.rr.com (Marty Leisner) Date: Mon, 09 Aug 2004 12:06:00 -0000 Subject: using #ident or #pragma ident Message-ID: <200408090402.i7942tVN002698@dell.home> I'm using 3.4.1 on linux I found documentation on #pragma ident and #ident skimpy -- I tried to use them and can't have them mark the output files... Can someone show me an example where these are used? : leisner@gateway;gcc -v foo.c -save-temps -c Reading specs from /usr/gnu/lib/gcc/i686-pc-linux-gnu/3.4.1/specs Configured with: /usr/local/src/gnu/gcc-3.4.1/configure --prefix=/usr/gnu --prog ram-suffix=-3.4.1 --enable-shared --enable-__cxa_atexit --with-system-zlib --ena ble-threads=posix --disable-checking Thread model: posix gcc version 3.4.1 /usr/gnu/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1 -E -quiet -v foo.c -mtune=pent iumpro -o foo.i ignoring nonexistent directory "/usr/gnu/lib/gcc/i686-pc-linux-gnu/3.4.1/../../ . ./../i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/gnu/include /usr/gnu/lib/gcc/i686-pc-linux-gnu/3.4.1/include /usr/include End of search list. /usr/gnu/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1 -fpreprocessed foo.i -quiet -d umpbase foo.c -mtune=pentiumpro -auxbase foo -version -o foo.s GNU C version 3.4.1 (i686-pc-linux-gnu) compiled by GNU C version 3.4.1. GGC heuristics: --param ggc-min-expand=72 --param ggc-min-heapsize=80392 foo.c:1:10: warning: extra tokens at end of #ident directive /usr/gnu/lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/bin/as - V -Qy -o foo.o foo.s GNU assembler version 2.15 (i686-pc-linux-gnu) using BFD version 2.15 : leisner@gateway;cat foo.c #ident "this is an ident" #pragma ident "this is a pragma" main() { } : leisner@gateway;cat foo.i # 1 "foo.c" # 1 "" # 1 "" # 1 "foo.c" #ident ""this is an ident"" #pragma ident "this is a pragma" main() { } : leisner@gateway;cat foo.s .file "foo.c" .ident "" .text .globl main .type main, @function main: pushl %ebp movl %esp, %ebp subl $8, %esp andl $-16, %esp movl $0, %eax addl $15, %eax addl $15, %eax shrl $4, %eax sall $4, %eax subl %eax, %esp leave ret .size main, .-main .section .note.GNU-stack,"",@progbits .ident "GCC: (GNU) 3.4.1" marty From ankitjain1580@yahoo.com Mon Aug 9 12:08:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 12:08:00 -0000 Subject: extended asm problem->pointers->m1 Message-ID: <20040809112006.67832.qmail@web52902.mail.yahoo.com> 1 #include 2 3 4 int main() 5 { 6 uint8_t a[8]={1,2,3,4,5,6,7,8},b[8]={0,0,0,0,0,0},i; 7 uint8_t *m,*m1; 8 9 m=a; 10 11 for(i=0;i<8;i++) 12 printf("%d ",a[i]); 13 printf("\n"); 14 asm("movq (%1), %%mm0 \n" 15 "movq %%mm0, (%1) \n" 16 :"=r"(m1) 17 :"r"(m) 18 ); 19 20 for(i=0;i<8;i++) 21 printf("%d ",b[i]); 22 return 0; 23 } the problem in this code is it is printing array b as 00000000 it is not moving the values WHY? ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From marcelo@jct.ac.il Mon Aug 9 12:15:00 2004 From: marcelo@jct.ac.il (Marcelo Roitburd) Date: Mon, 09 Aug 2004 12:15:00 -0000 Subject: memory function Message-ID: Hi ppl, I know i wrote before a few time about this , but i need to write again. i read a the list at net of the gcc help about this i can't found a real something that help me. i need to know how much memory use each function like a sizeof function , that ppl write here before. if someone can send me some example with use class. i read about mprof some one know something like about this? or if gprof have some argument to this? thanks very thanks -Marcelo From eljay@adobe.com Mon Aug 9 12:19:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 12:19:00 -0000 Subject: using #ident or #pragma ident References: <200408090402.i7942tVN002698@dell.home> Message-ID: <007901c47e09$8fbefb40$79b2f882@PS253> Hi Marty, Try: #ident "This is an ident" And don't forget the -fident switch on your compile line. --Eljay From eljay@adobe.com Mon Aug 9 13:02:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 13:02:00 -0000 Subject: inquiry References: <200408071307.QAA8603328@bina.wisdom.weizmann.ac.il> Message-ID: <009e01c47e0a$759183e0$79b2f882@PS253> Hi Bilha, The fastest, safest, and self-contained way of installing GCC on your PC/Linux machine is when you install Linux from your distribution, make sure you select "ALL" packages. That will install the GCC (and all its related components) that the distribution expects. If you've already installed Linux and need to install GCC after-the-fact, I'm not sure what the procedure is to install packages that were not installed at set-up time. HTH, --Eljay From eljay@adobe.com Mon Aug 9 13:18:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 13:18:00 -0000 Subject: extended asm problem->pointers->m1 References: <20040809112006.67832.qmail@web52902.mail.yahoo.com> Message-ID: <00bb01c47e0b$237bea40$79b2f882@PS253> Hi Ankit, Does m1 need to point to something? --Eljay From eljay@adobe.com Mon Aug 9 13:34:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 13:34:00 -0000 Subject: memory function References: Message-ID: <013c01c47e11$0b15fa30$79b2f882@PS253> Hi Marcelo, In code, there is no language specified reliable way to determine the size of a function. There are a few suspect tricks you could try (such as taking the address of the NEXT function in the source code and subtracting the address of the function of interest), but they are fraught with danger. Outside of the code, try using the "nm" and "objdump" commands to peruse the attributes of your object code. HTH, --Eljay From ankitjain1580@yahoo.com Mon Aug 9 13:45:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 13:45:00 -0000 Subject: extended asm problem ->pointer m1 Message-ID: <20040809131759.12545.qmail@web52910.mail.yahoo.com> sorry i made the mistake in explaining my problem if u can look at it again 1 #include 2 3 4 int main() 5 { 6 uint8_t a[8]={1,2,3,4,5,6,7,8},b[8]={0,0,0,0,0,0},i; 7 uint8_t *m,*m1; 8 9 m=a; 10 m1=b; //i have pointed m1 to b 11 for(i=0;i<8;i++) 12 printf("%d ",a[i]); 13 printf("\n"); 14 asm("movq (%1), %%mm0 \n" 15 "movq %%mm0, (%1) \n" 16 :"=r"(m1) 17 :"r"(m) 18 ); 19 20 for(i=0;i<8;i++) 21 printf("%d ",b[i]); 22 return 0; 23 } so i expect that b should be initialised the problem in this code is it is printing array b as 00000000 it is not moving the values WHY? ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From eljay@adobe.com Mon Aug 9 14:09:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 14:09:00 -0000 Subject: extended asm problem ->pointer m1 References: <20040809131759.12545.qmail@web52910.mail.yahoo.com> Message-ID: <01b401c47e15$91151ef0$79b2f882@PS253> Hi Ankit, Should you be using (%1) in both assembler statements? --Eljay From eljay@adobe.com Mon Aug 9 14:10:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 14:10:00 -0000 Subject: extended asm problem ->pointer m1 References: <20040809131759.12545.qmail@web52910.mail.yahoo.com> Message-ID: <01bf01c47e17$26f40390$79b2f882@PS253> Hi Ankit, Maybe it'd be easier just to use the arrays directly: asm ( "movq %0 , %%mm0\n\t" "movq %%mm0 , %1\n\t" :"=m" (a[0]) :"m" (b[0]) ); HTH, --Eljay From laflynn@lucent.com Mon Aug 9 14:25:00 2004 From: laflynn@lucent.com (Flynn, Lori Arline (Lori)) Date: Mon, 09 Aug 2004 14:25:00 -0000 Subject: gcc LALR? Message-ID: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> Hi, Does anybody know if gcc is LALR, LR, or LL? I can't find documentation on this. Thanks, Lori From laflynn@lucent.com Mon Aug 9 14:25:00 2004 From: laflynn@lucent.com (Flynn, Lori Arline (Lori)) Date: Mon, 09 Aug 2004 14:25:00 -0000 Subject: join Message-ID: <9B457B1322AAAE46BD5E693C02842C1D02FE0748@nj0117exch002u.wh.lucent.com> join From eljay@adobe.com Mon Aug 9 14:41:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 14:41:00 -0000 Subject: gcc LALR? References: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> Message-ID: <021401c47e1c$afbefd10$79b2f882@PS253> Hi Lori, As I understand it, I believe gcc (the C compiler of the GCC suite) is LALR. If you want to write your own front end to GCC, you'd probably want LALR. But that's up to you. There's an essay called "GCC Fontend HOWTO" by Sreejith K Menon that's pretty cool. (You'll have to Google for it. I don't have the URL.) Since I'm not sure why you want to know, I'm not sure where I can point you to get to where you want to be. HTH, --Eljay From lars.segerlund@comsys.se Mon Aug 9 14:56:00 2004 From: lars.segerlund@comsys.se (Lars Segerlund) Date: Mon, 09 Aug 2004 14:56:00 -0000 Subject: memory function In-Reply-To: References: Message-ID: <20040809160927.6aa94708@zeta.comsys.se> Hi, you can insert labels into the code at the points you desire ( ie. before and after ) and then resolve them at runtime. I did a trick like this in order to place code at a desired location ( stupid linker tricks :-) ... perhaps you should ask on the binutils list ? ). I fooled around until I managed to put a marker before and after the code I wanted to run, and then got the addresses at runtime .. Just a thought, Lars Segerlund. ( ps. I tried to find the code but it's long dead and I can't find it ). On Mon, 9 Aug 2004 15:06:33 +0300 (IDT) Marcelo Roitburd wrote: > > Hi ppl, > > I know i wrote before a few time about this , but i need to write again. > > i read a the list at net of the gcc help about this i can't found a real > something that help me. > > i need to know how much memory use each function like a sizeof function , > that ppl write here before. > > if someone can send me some example with use class. i read about mprof > some one know something like about this? or if gprof have some argument to > this? > > thanks very thanks > > > -Marcelo > From ankitjain1580@yahoo.com Mon Aug 9 15:20:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 15:20:00 -0000 Subject: sorry again:)->extended asm problem Message-ID: <20040809144126.17842.qmail@web52901.mail.yahoo.com> sorry again. i generally dont make such mistyakes while asking questiuons. but yes it should %0. and i want it through pointers. earlier my program was having all these things correct but somewhat later i have done all these mistakes in the code and while sending the problem i pasted this error code. i guess the code below is correct and i have to understand why array b is not initialised with the value 1 #include 2 3 4 int main() 5 { 6 uint8_t a[8]={1,2,3,4,5,6,7,8},b[8]={0,0,0,0,0,0},i; 7 uint8_t *m,*m1; 8 9 m=a; 10 m1=b; //i have pointed m1 to b 11 for(i=0;i<8;i++) 12 printf("%d ",a[i]); 13 printf("\n"); 14 asm("movq (%1), %%mm0 \n" 15 "movq %%mm0, (%0) \n" 16 :"=r"(m1) 17 :"r"(m) 18 ); 19 20 for(i=0;i<8;i++) 21 printf("%d ",b[i]); 22 return 0; 23 } so i expect that b should be initialised the problem in this code is it is printing array b as 00000000 it is not moving the values WHY? thanks a lot ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From Tom.Richardson@ci.greensboro.nc.us Mon Aug 9 15:29:00 2004 From: Tom.Richardson@ci.greensboro.nc.us (Richardson, Tom) Date: Mon, 09 Aug 2004 15:29:00 -0000 Subject: Apache Install Message-ID: <8AA6C9941957884BA59B0ECED88F42BA0493128A@paris.greensboronc.org> I'm attempting to install Apache 2.0 on AIX 5.2. Ran into problems with my IBM C Compiler, so installed GCC. Configure worked fine. Only used one option in the configure ./configure --enable-so Getting errors on the make command. The command it is running is as follows: Making all in srclib Making all in apr Making all in strings /bin/sh /803Environment/httpd-2.0.50/srclib/apr/libtool --silent --mode= compile gcc -g -O2 -DHAVE_CONFIG_H -U__STR__ -D_THREAD_SAFE -D_USE_IRS -I../ include -I../include/arch/unix -c apr_snprintf.c && touch apr_snprintf.lo The error: In file included from ../include/apr_portable.h:46, from apr_snprintf.c:22: /usr/include/pthread.h:554: error: parse error before '*' token /usr/include/pthread.h:557: error: parse error before '*' token /usr/include/pthread.h:561: error: parse error before '*' token /usr/include/pthread.h:564: error: parse error before '*' token /usr/include/pthread.h:567: error: parse error before '*' token /usr/include/pthread.h:570: error: parse error before '*' token /usr/include/pthread.h:573: error: parse error before '*' token /usr/include/pthread.h:576: error: parse error before '*' token /usr/include/pthread.h:579: error: parse error before '*' token /usr/include/pthread.h:583: error: parse error before '*' token /usr/include/pthread.h:586: error: parse error before '*' token make: 1254-004 The error code from the last command is 1. I installed gcc binaries without any configuration. Any ideas greatly appreciated. Tom Richardson Application Services (336) 373-2016 tom.richardson@greensboro-nc.gov From pluto@pld-linux.org Mon Aug 9 16:05:00 2004 From: pluto@pld-linux.org (=?utf-8?q?Pawe=C5=82_Sikora?=) Date: Mon, 09 Aug 2004 16:05:00 -0000 Subject: sorry again:)->extended asm problem In-Reply-To: <20040809144126.17842.qmail@web52901.mail.yahoo.com> References: <20040809144126.17842.qmail@web52901.mail.yahoo.com> Message-ID: <200408091720.17349.pluto@pld-linux.org> # gcc -s -O2 mmx.c # ./a.out 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 -- /* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */ #define say(x) lie(x) -------------- next part -------------- A non-text attachment was scrubbed... Name: mmx.c Type: text/x-csrc Size: 435 bytes Desc: not available URL: From thebrasse@brasse.org Mon Aug 9 16:33:00 2004 From: thebrasse@brasse.org (=?ISO-8859-1?Q?Mattias_Br=E4ndstr=F6m?=) Date: Mon, 09 Aug 2004 16:33:00 -0000 Subject: Confused about linking Message-ID: <41179843.5010404@brasse.org> Hello! I am seriously confused when it comes to linking my executable written in C++. More specificaly I want to link againts boost_thread and boost_regex on a Fedora 2 system. These files are located in /usr/lib: /usr/lib/libboost_thread.so.1 /usr/lib/libboost_thread.so.1.31.0 /usr/lib/libboost_regex.a /usr/lib/libboost_regex.so.1.31.0 /usr/lib/libboost_regex.so.1 I have a small file named 'foo.cpp' containing the following: int main() { return 0; } When I try the following: g++ foo.cpp -L/usr/lib -lboost_regex everthing works fine. But when I do this: g++ foo.cpp -L/usr/lib -lboost_thread I get: /usr/bin/ld: cannot find -lboost_thread collect2: ld returned 1 exit status When removing /usr/lib/libboost_regex.a I get the same error as above when trying to 'g++ foo.cpp -L/usr/lib -lboost_regex'. I was under the impression that g++ would look for shared librarires and try to link againt them first and if that didn't work try to link againt static libraries. Perhaps this is not tha case? Can someone enlighten me on this, probalbly trivial, issue? Thanks in advance! :.:: mattias PS. > g++ -v foo.cpp -L/usr/lib -lboost_thread Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SOURCE foo.cpp -D__GNUG__=3 -quiet -dumpbase foo.cpp -auxbase foo -version -o /tmp/cccCYtHd.s GNU C++ version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) (i386-redhat-linux) compiled by GNU C version 3.3.3 20040412 (Red Hat Linux 3.3.3-7). GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64549 ignoring nonexistent directory "/usr/i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/include/c++/3.3.3 /usr/include/c++/3.3.3/i386-redhat-linux /usr/include/c++/3.3.3/backward /usr/local/include /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include /usr/include End of search list. as -V -Qy -o /tmp/ccqqpjhi.o /tmp/cccCYtHd.s GNU assembler version 2.15.90.0.3 (i386-redhat-linux) using BFD version 2.15.90.0.3 20040415 /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crt1.o /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crti.o /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtbegin.o -L/usr/lib -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3 -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../.. /tmp/ccqqpjhi.o -lboost_thread -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtend.o /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crtn.o /usr/bin/ld: cannot find -lboost_thread collect2: ld returned 1 exit status From eljay@adobe.com Mon Aug 9 17:10:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 17:10:00 -0000 Subject: Confused about linking References: <41179843.5010404@brasse.org> Message-ID: <02c201c47e2a$b7e4fc20$79b2f882@PS253> Hi Mattias, Try this... cd /usr/lib ln -s libboost_thread.so.1 libboost_thread.so ln -s libboost_regex.so.1 libboost_regex.so Then see if it links. Otherwise, try putting in the fully qualified pathname: g++ foo.cpp /usr/bin/libboost_regex.so.1 /usr/bin/libboost_thread.so.1 HTH, --Eljay From ankitjain1580@yahoo.com Mon Aug 9 17:23:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 17:23:00 -0000 Subject: sorry again:)->extended asm problem In-Reply-To: <200408091720.17349.pluto@pld-linux.org> Message-ID: <20040809163330.26329.qmail@web52903.mail.yahoo.com> hi thanks a lot :) but i wanted to do it through pointers? i am not able to understand why it cant happen with pointers? what u told is fine except i could not understand "volaitle"? thanks ankit --- Pawe? ??_Sikora wrote: > # gcc -s -O2 mmx.c > > # ./a.out > 1 2 3 4 5 6 7 8 > 1 2 3 4 5 6 7 8 > > > -- > /* Copyright (C) 2003, SCO, Inc. This is valuable > Intellectual Property. */ > > #define say(x) lie(x) > > #include > #include > > uint8_t a[8] = { 1, 2, 3, 4, 5, 6, 7, 8}, > b[8] = { 0, 0, 0, 0, 0, 0, 0, 0}; > > int main() > { > int i; > for(i = 0; i < 8; i++) > printf("%d ",a[i]); > printf("\n"); > > asm volatile ( > "movq (%0), %%mm0 \n\t" > "movq %%mm0, (%1) \n\t" > : // outputs > : "r"(a), "r" (b) // inputs > : "mm0" // clobbers > ); > > for(i = 0; i < 8; i++) > printf("%d ",b[i]); > printf("\n"); > return 0; > } > ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From ankitjain1580@yahoo.com Mon Aug 9 17:33:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 17:33:00 -0000 Subject: problem in extended asm Message-ID: <20040809171020.61634.qmail@web52901.mail.yahoo.com> hi a simple question: why the followinf instruction dosent work in gcc for(i=0;i<8;i++) { asm("movq i(%1),%%mm0 \n" "movq %%mm0,(%0) :"=r"(x) :"r"(m)); //m is an array } for(i=0;i<8;i++) printf("%d",x[i]) thanks ankit jain ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From zack@codesourcery.com Mon Aug 9 18:14:00 2004 From: zack@codesourcery.com (Zack Weinberg) Date: Mon, 09 Aug 2004 18:14:00 -0000 Subject: problem in extended asm In-Reply-To: <20040809171020.61634.qmail@web52901.mail.yahoo.com> (Ankit Jain's message of "Mon, 9 Aug 2004 18:10:20 +0100 (BST)") References: <20040809171020.61634.qmail@web52901.mail.yahoo.com> Message-ID: <873c2wuswl.fsf@codesourcery.com> Ankit Jain writes: > hi > > a simple question: why the followinf instruction > dosent work in gcc > for(i=0;i<8;i++) > { > asm("movq i(%1),%%mm0 \n" > "movq %%mm0,(%0) > :"=r"(x) > :"r"(m)); //m is an array > } > for(i=0;i<8;i++) > printf("%d",x[i]) This sort of question is appropriate for gcc-help only; cc: adjusted. We cannot tell you exactly what is wrong when you provide only a code fragment like this. However, I can tell you right now that referring to "i" directly in the assembler, as you have done, does not work. You need to treat _all_ variables as operands. Also you forgot to clobber mm0. And did you really mean to index the access to x, but not m? I suspect (but cannot be sure, since you did not provide a complete test case) that what you really want to write is something like asm ("movq %1,%%mm0\n\t" "movq %%mm0, %0" : "=m" (x[i]) : "m" (m[i]) : "mm0"); If you really meant to index only x, not m, then you can write this even simpler: asm ("movq %1,%0" : "=m" (x[i]) : "y" (m[0])); (a "y" constraint puts the value in an MMX register). zw From dk@artimi.com Mon Aug 9 22:04:00 2004 From: dk@artimi.com (Dave Korn) Date: Mon, 09 Aug 2004 22:04:00 -0000 Subject: problem in extended asm In-Reply-To: <20040809171020.61634.qmail@web52901.mail.yahoo.com> Message-ID: > -----Original Message----- > From: gcc-owner On Behalf Of Ankit Jain > Sent: 09 August 2004 18:10 > hi > > a simple question: why the followinf instruction > dosent work in gcc > for(i=0;i<8;i++) > { > asm("movq i(%1),%%mm0 \n" > "movq %%mm0,(%0) > :"=r"(x) > :"r"(m)); //m is an array > } You forgot a closing quote. cheers, DaveK -- Can't think of a witty .sigline today.... From ankitjain1580@yahoo.com Mon Aug 9 22:48:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 22:48:00 -0000 Subject: problem in extended asm In-Reply-To: Message-ID: <20040809181418.54547.qmail@web52909.mail.yahoo.com> no not a question of closing quote consider if it is there --- Dave Korn wrote: > > -----Original Message----- > > From: gcc-owner On Behalf Of Ankit Jain > > Sent: 09 August 2004 18:10 > > > hi > > > > a simple question: why the followinf instruction > > dosent work in gcc > > for(i=0;i<8;i++) > > { > > asm("movq i(%1),%%mm0 \n" > > "movq %%mm0,(%0) > > :"=r"(x) > > :"r"(m)); //m is an array > > } > > You forgot a closing quote. > > > cheers, > DaveK > -- > Can't think of a witty .sigline today.... > > ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From jeff.holle@verizon.net Mon Aug 9 22:54:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Mon, 09 Aug 2004 22:54:00 -0000 Subject: question about anonymous union usage Message-ID: I'm using g++ v3.4.1. I'm considering using an anonymous union in the following fashion: class SomeClass { .... private: bool isPseudo_; union { LayoutVertex *layoutVertex_; PseudoVertex *pseudoVertex_; }; } Both LayoutVertex and PseudoVertex have the same methods. Only in the constructors of SomeClass will I have to code in a way that differenciates between layoutVertex_ and psuedoVertex_. My question is can I safely use layoutVertex_ elsewhere even if its initialized with a PsuedoVertex object? From ishwar@pali.cps.cmich.edu Tue Aug 10 00:23:00 2004 From: ishwar@pali.cps.cmich.edu (Ishwar Rattan) Date: Tue, 10 Aug 2004 00:23:00 -0000 Subject: Confused about linking In-Reply-To: <41179843.5010404@brasse.org> References: <41179843.5010404@brasse.org> Message-ID: -lxx implies that libxx.a exists in the specified path, has nothing to do with shared libraries. Install libboost-thread first! -ishwar On Mon, 9 Aug 2004, [ISO-8859-1] Mattias Br?ndstr?m wrote: > Hello! > > I am seriously confused when it comes to linking my executable written > in C++. More specificaly I want to link againts boost_thread and > boost_regex on a Fedora 2 system. > > These files are located in /usr/lib: > > /usr/lib/libboost_thread.so.1 > /usr/lib/libboost_thread.so.1.31.0 > /usr/lib/libboost_regex.a > /usr/lib/libboost_regex.so.1.31.0 > /usr/lib/libboost_regex.so.1 > > I have a small file named 'foo.cpp' containing the following: > > int main() > { > return 0; > } > > When I try the following: > > g++ foo.cpp -L/usr/lib -lboost_regex > > everthing works fine. But when I do this: > > g++ foo.cpp -L/usr/lib -lboost_thread > > I get: > > /usr/bin/ld: cannot find -lboost_thread > collect2: ld returned 1 exit status > > When removing /usr/lib/libboost_regex.a I get the same error as above > when trying to 'g++ foo.cpp -L/usr/lib -lboost_regex'. > > I was under the impression that g++ would look for shared librarires and > try to link againt them first and if that didn't work try to link againt > static libraries. Perhaps this is not tha case? Can someone enlighten me > on this, probalbly trivial, issue? > > Thanks in advance! > > :.:: mattias > > PS. > > g++ -v foo.cpp -L/usr/lib -lboost_thread > > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man > --infodir=/usr/share/info --enable-shared --enable-threads=posix > --disable-checking --disable-libunwind-exceptions --with-system-zlib > --enable-__cxa_atexit --host=i386-redhat-linux > Thread model: posix > gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/cc1plus -quiet -v > -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SOURCE > foo.cpp -D__GNUG__=3 -quiet -dumpbase foo.cpp -auxbase foo -version -o > /tmp/cccCYtHd.s > GNU C++ version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) (i386-redhat-linux) > compiled by GNU C version 3.3.3 20040412 (Red Hat Linux 3.3.3-7). > GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64549 > ignoring nonexistent directory "/usr/i386-redhat-linux/include" > #include "..." search starts here: > #include <...> search starts here: > /usr/include/c++/3.3.3 > /usr/include/c++/3.3.3/i386-redhat-linux > /usr/include/c++/3.3.3/backward > /usr/local/include > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include > /usr/include > End of search list. > as -V -Qy -o /tmp/ccqqpjhi.o /tmp/cccCYtHd.s > GNU assembler version 2.15.90.0.3 (i386-redhat-linux) using BFD version > 2.15.90.0.3 20040415 > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/collect2 --eh-frame-hdr -m > elf_i386 -dynamic-linker /lib/ld-linux.so.2 > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crt1.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crti.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtbegin.o -L/usr/lib > -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3 > -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../.. /tmp/ccqqpjhi.o > -lboost_thread -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtend.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crtn.o > /usr/bin/ld: cannot find -lboost_thread > collect2: ld returned 1 exit status > From lrtaylor@micron.com Tue Aug 10 02:17:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Tue, 10 Aug 2004 02:17:00 -0000 Subject: Confused about linking Message-ID: <363801FFD7B74240A329CEC3F7FE4CC40215DBA7@ntxboimbx07.micron.com> No, that is not right. If you look at his file listing, he obviously does have libboost_thread installed. -lxx causes the linker to look first for libxx.so and then libxx.a, unless you override that default by specifying the appropriate actions. In this case, with -lboost_thread, it's going to look for libboost_thread.so and then libboost_thread.a. However, neither of them exists - instead, you have libboost_thread.so.1. Create a symbolic link in /usr/lib named libboost_thread.so to libboost_thread.so.1, and you should be OK. For example, execute the following commands: su (must be logged in as root) cd /usr/bin ln -s libboost_thread.so.1 libboost_thread.so Cheers, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Ishwar Rattan Sent: Monday, August 09, 2004 4:51 PM To: Mattias Br?ndstr?m Cc: gcc-help@gcc.gnu.org Subject: Re: Confused about linking -lxx implies that libxx.a exists in the specified path, has nothing to do with shared libraries. Install libboost-thread first! -ishwar On Mon, 9 Aug 2004, [ISO-8859-1] Mattias Br?ndstr?m wrote: > Hello! > > I am seriously confused when it comes to linking my executable written > in C++. More specificaly I want to link againts boost_thread and > boost_regex on a Fedora 2 system. > > These files are located in /usr/lib: > > /usr/lib/libboost_thread.so.1 > /usr/lib/libboost_thread.so.1.31.0 > /usr/lib/libboost_regex.a > /usr/lib/libboost_regex.so.1.31.0 > /usr/lib/libboost_regex.so.1 > > I have a small file named 'foo.cpp' containing the following: > > int main() > { > return 0; > } > > When I try the following: > > g++ foo.cpp -L/usr/lib -lboost_regex > > everthing works fine. But when I do this: > > g++ foo.cpp -L/usr/lib -lboost_thread > > I get: > > /usr/bin/ld: cannot find -lboost_thread > collect2: ld returned 1 exit status > > When removing /usr/lib/libboost_regex.a I get the same error as above > when trying to 'g++ foo.cpp -L/usr/lib -lboost_regex'. > > I was under the impression that g++ would look for shared librarires and > try to link againt them first and if that didn't work try to link againt > static libraries. Perhaps this is not tha case? Can someone enlighten me > on this, probalbly trivial, issue? > > Thanks in advance! > > :.:: mattias > > PS. > > g++ -v foo.cpp -L/usr/lib -lboost_thread > > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man > --infodir=/usr/share/info --enable-shared --enable-threads=posix > --disable-checking --disable-libunwind-exceptions --with-system-zlib > --enable-__cxa_atexit --host=i386-redhat-linux > Thread model: posix > gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/cc1plus -quiet -v > -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SOURCE > foo.cpp -D__GNUG__=3 -quiet -dumpbase foo.cpp -auxbase foo -version -o > /tmp/cccCYtHd.s > GNU C++ version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) (i386-redhat-linux) > compiled by GNU C version 3.3.3 20040412 (Red Hat Linux 3.3.3-7). > GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64549 > ignoring nonexistent directory "/usr/i386-redhat-linux/include" > #include "..." search starts here: > #include <...> search starts here: > /usr/include/c++/3.3.3 > /usr/include/c++/3.3.3/i386-redhat-linux > /usr/include/c++/3.3.3/backward > /usr/local/include > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include > /usr/include > End of search list. > as -V -Qy -o /tmp/ccqqpjhi.o /tmp/cccCYtHd.s > GNU assembler version 2.15.90.0.3 (i386-redhat-linux) using BFD version > 2.15.90.0.3 20040415 > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/collect2 --eh-frame-hdr -m > elf_i386 -dynamic-linker /lib/ld-linux.so.2 > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crt1.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crti.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtbegin.o -L/usr/lib > -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3 > -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../.. /tmp/ccqqpjhi.o > -lboost_thread -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtend.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crtn.o > /usr/bin/ld: cannot find -lboost_thread > collect2: ld returned 1 exit status > From laflynn@lucent.com Tue Aug 10 07:15:00 2004 From: laflynn@lucent.com (Flynn, Lori Arline (Lori)) Date: Tue, 10 Aug 2004 07:15:00 -0000 Subject: SSA code debugging Message-ID: <9B457B1322AAAE46BD5E693C02842C1D030D2853@nj0117exch002u.wh.lucent.com> Hi, >From an SSA-labelled source line, I'd like to find that particular SSA-labeled variable in the object code. Is that possible? Thanks, in advance, for help! -Lori From bernie@develer.com Tue Aug 10 08:08:00 2004 From: bernie@develer.com (Bernardo Innocenti) Date: Tue, 10 Aug 2004 08:08:00 -0000 Subject: problem in extended asm In-Reply-To: References: Message-ID: <4117BEAC.5050307@develer.com> Dave Korn wrote: >>-----Original Message----- >>From: gcc-owner On Behalf Of Ankit Jain >>Sent: 09 August 2004 18:10 > > >>hi >> >>a simple question: why the followinf instruction >>dosent work in gcc >>for(i=0;i<8;i++) >>{ >>asm("movq i(%1),%%mm0 \n" >> "movq %%mm0,(%0) >> :"=r"(x) >> :"r"(m)); //m is an array >>} > > You forgot a closing quote. And a \t after the \n. Without it, the second movq would start at the beginning of the line and be interpreted as a label by the assembler. -- // Bernardo Innocenti - Develer S.r.l., R&D dept. \X/ http://www.develer.com/ From thebrasse@brasse.org Tue Aug 10 09:00:00 2004 From: thebrasse@brasse.org (=?ISO-8859-1?Q?Mattias_Br=E4ndstr=F6m?=) Date: Tue, 10 Aug 2004 09:00:00 -0000 Subject: Confused about linking In-Reply-To: <363801FFD7B74240A329CEC3F7FE4CC40215DBA7@ntxboimbx07.micron.com> References: <363801FFD7B74240A329CEC3F7FE4CC40215DBA7@ntxboimbx07.micron.com> Message-ID: <4118761B.7070801@brasse.org> lrtaylor@micron.com wrote: > -lxx causes the linker to look first for libxx.so and then libxx.a, unless you override that default by specifying the appropriate actions. In this case, with -lboost_thread, it's going to look for libboost_thread.so and then libboost_thread.a. However, neither of them exists - instead, you have libboost_thread.so.1. Create a symbolic link in /usr/lib named libboost_thread.so to libboost_thread.so.1, and you should be OK. > > For example, execute the following commands: > > su (must be logged in as root) > cd /usr/bin > ln -s libboost_thread.so.1 libboost_thread.so > Thanks everyone! When creating the symbolic link everything works fine! Now why didn't I try that in the first place? =) :.:: mattias From zzz@anda.ru Tue Aug 10 10:34:00 2004 From: zzz@anda.ru (Denis Zaitsev) Date: Tue, 10 Aug 2004 10:34:00 -0000 Subject: problem in extended asm In-Reply-To: <4117BEAC.5050307@develer.com>; from bernie@develer.com on Mon, Aug 09, 2004 at 08:13:00PM +0200 References: <4117BEAC.5050307@develer.com> Message-ID: <20040810140818.D5885@natasha.ward.six> On Mon, Aug 09, 2004 at 08:13:00PM +0200, Bernardo Innocenti wrote: > > > Dave Korn wrote: > >>-----Original Message----- > >>From: gcc-owner On Behalf Of Ankit Jain > >>Sent: 09 August 2004 18:10 > > > > > >>hi > >> > >>a simple question: why the followinf instruction > >>dosent work in gcc > >>for(i=0;i<8;i++) > >>{ > >>asm("movq i(%1),%%mm0 \n" > >> "movq %%mm0,(%0) > >> :"=r"(x) > >> :"r"(m)); //m is an array > >>} > > > > You forgot a closing quote. > > And a \t after the \n. Without it, the second movq would > start at the beginning of the line and be interpreted as > a label by the assembler. It's not true. It will be interpreted correctly. At least, for the x86 assembler. From rinku_ques@yahoo.com Tue Aug 10 10:38:00 2004 From: rinku_ques@yahoo.com (rinku rathore) Date: Tue, 10 Aug 2004 10:38:00 -0000 Subject: problem: "segmentation fault" Message-ID: <20040810085601.86326.qmail@web61205.mail.yahoo.com> hello, I had made a program to read a file and storing its contents in two dimensional array of 256*256,and a error "segmentation fault" occured how can I remove it plz tell. Rinku Rathore __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail From djp@cs.uvic.ca Tue Aug 10 10:56:00 2004 From: djp@cs.uvic.ca (David Pereira) Date: Tue, 10 Aug 2004 10:56:00 -0000 Subject: Building GCC on a Mac OS X machine Message-ID: Hello, I was wondering whether it is possible to build gcc-3.4.1 from scratch (pristine sources from gcc.gnu.org) on OS X. 1. Does it build properly without hassle ? Does it work, once built ? 2. More precisely, are all the prerequisite programs for the build process listed at http://gcc.gnu.org/install/prerequisites.html available and functional on OS X. 3. Does it build reasonably quickly ? 4. Apart from just building properly and running, does it produce correct object files/executables/shared libraries for OS X ? 5. Is any part of GCC broken with respect to OS X ? The crux of the matter is "I will be doing development of GCC with GCC on an OS X machine. I do not want to purchase an OS X machine only to find that the afore-mentioned objective cannot be fulfilled." In particular, the existence of the apple-provided version of the gcc compiler is pretty much immaterial to me --- I shall use it only for the initial build of the gcc.gnu.org sources. Hoping to hear from people who have built GCC on their OS X machines, preferrably even those are actively developing the GCC compiler itself on OS X. Can GCC (pristine gcc.gnu.org sources) "shake, rattle and roll" on OS X ? Thanks. David. From andrea_pretto@yahoo.it Tue Aug 10 11:53:00 2004 From: andrea_pretto@yahoo.it (Andrea Pretto) Date: Tue, 10 Aug 2004 11:53:00 -0000 Subject: gcc LALR? In-Reply-To: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> References: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> Message-ID: <1092138105.723.6.camel@debian-host> The Gcc parser is a LALR grammar file for Bison, which is a LALR parser generator. Therefore, if you want to say that, gcc is LALR. On Mon, 2004-08-09 at 16:10, Flynn, Lori Arline (Lori) wrote: > Hi, > > Does anybody know if gcc is LALR, LR, or LL? I can't find documentation on this. > > Thanks, > Lori From fw@deneb.enyo.de Tue Aug 10 11:58:00 2004 From: fw@deneb.enyo.de (Florian Weimer) Date: Tue, 10 Aug 2004 11:58:00 -0000 Subject: gcc LALR? In-Reply-To: <1092138105.723.6.camel@debian-host> (Andrea Pretto's message of "Tue, 10 Aug 2004 13:41:45 +0200") References: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> <1092138105.723.6.camel@debian-host> Message-ID: <87vffr2rdl.fsf@deneb.enyo.de> * Andrea Pretto: > The Gcc parser is a LALR grammar file for Bison, which is a LALR > parser generator. GCC includes various parsers. The C++ and Ada parsers are hand-written recursive descent parsers. From eljay@adobe.com Tue Aug 10 14:02:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 10 Aug 2004 14:02:00 -0000 Subject: question about anonymous union usage References: Message-ID: <002301c47ed0$a9f80e80$13b2f882@PS253> Hi Jeff, Do you mean use the layoutVertex_ the pointer member variable in SomeClass elsewhere? Or use the layoutVertex_ thing-pointed-to (but is really a pseudoVertex_) elsewhere? --Eljay From eljay@adobe.com Tue Aug 10 14:07:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 10 Aug 2004 14:07:00 -0000 Subject: problem: "segmentation fault" References: <20040810085601.86326.qmail@web61205.mail.yahoo.com> Message-ID: <005201c47ed1$5a792550$13b2f882@PS253> Hi Rinku, Please provide a short coding example that reproduces the problem. Thanks, --ELjay From jeff.holle@verizon.net Tue Aug 10 14:10:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Tue, 10 Aug 2004 14:10:00 -0000 Subject: question about anonymous union usage In-Reply-To: <002301c47ed0$a9f80e80$13b2f882@PS253> References: <002301c47ed0$a9f80e80$13b2f882@PS253> Message-ID: The later. I will have isPseudo_ properly set to identify what type of pointer the union holds, but I want to ignore it in all SomeClass methods except its constructors. If I do this, there will be times that layoutVertex_ will point to a type of PseudoVertex and I'll treat it like a LayoutVertex. Again, all methods of LayoutVertex and pseudoVertex are the same. Eljay Love-Jensen wrote: > Hi Jeff, > > Do you mean use the layoutVertex_ the pointer member variable in SomeClass > elsewhere? > > Or use the layoutVertex_ thing-pointed-to (but is really a pseudoVertex_) > elsewhere? > > --Eljay > > From andrea_pretto@yahoo.it Tue Aug 10 17:17:00 2004 From: andrea_pretto@yahoo.it (Andrea Pretto) Date: Tue, 10 Aug 2004 17:17:00 -0000 Subject: gcc LALR? In-Reply-To: <87vffr2rdl.fsf@deneb.enyo.de> References: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> <1092138105.723.6.camel@debian-host> <87vffr2rdl.fsf@deneb.enyo.de> Message-ID: <1092150643.2581.2.camel@debian-host> On Tue, 2004-08-10 at 12:56, Florian Weimer wrote: > * Andrea Pretto: > > > The Gcc parser is a LALR grammar file for Bison, which is a LALR > > parser generator. > > GCC includes various parsers. The C++ and Ada parsers are > hand-written recursive descent parsers. Yes , right. I understood the C parser. From eljay@adobe.com Tue Aug 10 22:00:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 10 Aug 2004 22:00:00 -0000 Subject: question about anonymous union usage References: <002301c47ed0$a9f80e80$13b2f882@PS253> Message-ID: <017201c47ee3$ca5e9a50$13b2f882@PS253> Hi Jeff, > I will have isPseudo_ properly set to identify what type of pointer the union holds, but I want to ignore it in all SomeClass methods except its constructors. You should check for it in all SomeClass methods, and do things like: void SomeClass::doDance() { if(isPseudo_) pseudoVertex_->doDance(); else layoutVertex_->doDance(); }; > If I do this, there will be times that layoutVertex_ will point to a type of PseudoVertex and I'll treat it like a LayoutVertex. Then there will be times when the SomeClass object will have a pointer to PseudoVertex and you'll call the methods as if you had a pointer to LayoutVertex. Antics and hijinks ensue. HTH, --Eljay From lrtaylor@micron.com Wed Aug 11 00:13:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Wed, 11 Aug 2004 00:13:00 -0000 Subject: problem: "segmentation fault" Message-ID: <363801FFD7B74240A329CEC3F7FE4CC403096088@ntxboimbx07.micron.com> Rinku, First you need to figure out where it happened. When you build your program, add -g to the compiler options if it's not already there. That causes it to generate debugging information. When your program crashes it should create a core file. That file should either be named "core", or "core.nnnn", where "nnnn" is replaced with the process ID of the program that crashed, for example, "core.1234". You can use the GNU debugger "gdb" to examine the stack and see what line of code your program crashed on. For example, if your program is named my_prog, and your core file is just "core", you can open the core file in gdb like this: gdb my_prog core Then, you can look at the stack trace by typing "where" at the prompt. Look at the first line of the output and see if it tells you what line of your source code the error occurred on, and go back and see if you can see anything wrong with that line of code. Good luck! Cheers, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of rinku rathore Sent: Tuesday, August 10, 2004 2:56 AM To: gcc-help@gcc.gnu.org Subject: problem: "segmentation fault" hello, I had made a program to read a file and storing its contents in two dimensional array of 256*256,and a error "segmentation fault" occured how can I remove it plz tell. Rinku Rathore __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail From pkoning@equallogic.com Wed Aug 11 01:34:00 2004 From: pkoning@equallogic.com (Paul Koning) Date: Wed, 11 Aug 2004 01:34:00 -0000 Subject: problem in extended asm References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> Message-ID: <16665.17765.539593.671110@gargle.gargle.HOWL> >>>>> "Denis" == Denis Zaitsev writes: Denis> On Mon, Aug 09, 2004 at 08:13:00PM +0200, Bernardo Innocenti Denis> wrote: >> >> >> Dave Korn wrote: >>-----Original Message----- >>From: gcc-owner On >> Behalf Of Ankit Jain >>Sent: 09 August 2004 18:10 >> > >> > >> >>hi >> >> >> >>a simple question: why the followinf instruction >>dosent work >> in gcc >>for(i=0;i<8;i++) >>{ >>asm("movq i(%1),%%mm0 \n" >> "movq >> %%mm0,(%0) >> :"=r"(x) >> :"r"(m)); //m is an array >>} >> > >> > You forgot a closing quote. >> >> And a \t after the \n. Without it, the second movq would start at >> the beginning of the line and be interpreted as a label by the >> assembler. Denis> It's not true. It will be interpreted correctly. At least, Denis> for the x86 assembler. The same goes for many other assemblers. It depends on the syntax rules -- some assemblers believe that a token in column 1 is a label, some believe a token must be followed by colon (and often doesn't have to be in column 1) to be a label. GAS appears to be one such. paul From schwab@suse.de Wed Aug 11 06:35:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Wed, 11 Aug 2004 06:35:00 -0000 Subject: problem in extended asm In-Reply-To: <16665.17765.539593.671110@gargle.gargle.HOWL> (Paul Koning's message of "Tue, 10 Aug 2004 18:00:05 -0400") References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> <16665.17765.539593.671110@gargle.gargle.HOWL> Message-ID: Paul Koning writes: > The same goes for many other assemblers. It depends on the syntax > rules -- some assemblers believe that a token in column 1 is a label, > some believe a token must be followed by colon (and often doesn't have > to be in column 1) to be a label. GAS appears to be one such. Unless it is used in MRI-compatibility mode. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From linux@rochester.rr.com Wed Aug 11 08:38:00 2004 From: linux@rochester.rr.com (Marty Leisner) Date: Wed, 11 Aug 2004 08:38:00 -0000 Subject: using #ident or #pragma ident Message-ID: <200408110133.i7B1Xgl3002376@dell.home> Eljay Love-Jensen writes on Mon, 09 Aug 2004 07:08:19 CDT > Hi Marty, > > Try: > #ident "This is an ident" > And don't forget the -fident switch on your compile line. > > --Eljay 3.3.2 worked, 3.4.0 started to have problems.... 3.4.0 gives a parse error: : leisner@soyata;gcc-3.4.0 -save-temps -s foo.c foo.c:1:10: warning: extra tokens at end of #ident directive marty From ankitjain1580@yahoo.com Wed Aug 11 08:52:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Wed, 11 Aug 2004 08:52:00 -0000 Subject: problem with pointers in asm Message-ID: <20040811063556.44421.qmail@web52907.mail.yahoo.com> hi well i want to understand how assembler treats pointers? my code is: 1 #include 2 3 4 int main() 5 { 6 uint8_t a[8]={1,2,3,4,5,6,7,8},b[8]={0,0,0,0,0,0},i; 7 uint8_t *m,*m1; 8 9 m=a; 10 m1=b; //i have pointed m1 to b 11 for(i=0;i<8;i++) 12 printf("%d ",a[i]); 13 printf("\n"); 14 asm("movq (%1), %%mm0 \n" 15 "movq %%mm0, (%0) \n" 16 :"=r"(m1) 17 :"r"(m) 18 ); 19 20 for(i=0;i<8;i++) 21 printf("%d ",b[i]); 22 return 0; 23 } well this problem is not solved yet. because when i display b array then it prints all 0's. according to me since i have initialised this m1 pointer then by b then b whould have all the values which i have moved some have advised me to use arrays here as constraint but i want to use pointers. i am using r constraint and it says it says that m1 will use a register (i guess there is no problem in that) what is the complete problem HOW THIS ASSEMBLER IS TREATING THIS POINTER m1? thanks ankit jain ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From ankitjain1580@yahoo.com Wed Aug 11 09:04:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Wed, 11 Aug 2004 09:04:00 -0000 Subject: problem with pointers in asm In-Reply-To: <20040811080658.GA10320@login-4.efd.lth.se> Message-ID: <20040811083853.19662.qmail@web52903.mail.yahoo.com> thanks but still i am not clear how m1 is input to asm()? and if u can explain this " "memory" since your asm() changes memory." thanks ankit --- Fredrik Olofsson wrote: > On Wed, Aug 11, 2004 at 07:35:56AM +0100, Ankit Jain > wrote: > > 14 asm("movq (%1), %%mm0 \n" > > 15 "movq %%mm0, (%0) \n" > > 16 :"=r"(m1) > > 17 :"r"(m) > > 18 ); > > m1 is used as an input to the asm(), so adding > "r"(m1) to line 17 and removing it from line 16 > fixes the problem. Probably you should also add a > line 17.5 : "memory" since your asm() changes > memory. > > asm("movq (%1), %%mm0 \n" > "movq %%mm0, (%0) \n" > : > : "r"(m1), "r"(m) > : "memory" > ); > > Cheers, > /Fredrik > ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From amrith.chandri@oracle.com Wed Aug 11 09:31:00 2004 From: amrith.chandri@oracle.com (amrith chandri) Date: Wed, 11 Aug 2004 09:31:00 -0000 Subject: Hidden symbols Message-ID: Hi , I have seen some symbols in the symbol table are attributed as .HIDDEN, sometimes while linking with these libraries, i am getting the Hidden symbol issue from ld and ld exits. Can anyone explain, why this hidden symbol is used ? and any work around link against the hidden symbols. thanks amrith From dk@artimi.com Wed Aug 11 10:26:00 2004 From: dk@artimi.com (Dave Korn) Date: Wed, 11 Aug 2004 10:26:00 -0000 Subject: problem in extended asm In-Reply-To: <20040810140818.D5885@natasha.ward.six> Message-ID: > -----Original Message----- > From: Denis Zaitsev [mailto:zzz@anda.ru] > Sent: 10 August 2004 09:08 > To: Bernardo Innocenti > Cc: Dave Korn; 'gcc'; 'gcc' > Subject: Re: problem in extended asm > > On Mon, Aug 09, 2004 at 08:13:00PM +0200, Bernardo Innocenti wrote: > > > > > > Dave Korn wrote: > > >>-----Original Message----- > > >>From: gcc-owner On Behalf Of Ankit Jain > > >>Sent: 09 August 2004 18:10 > > > > > > > > >>hi > > >> > > >>a simple question: why the followinf instruction > > >>dosent work in gcc > > >>for(i=0;i<8;i++) > > >>{ > > >>asm("movq i(%1),%%mm0 \n" > > >> "movq %%mm0,(%0) > > >> :"=r"(x) > > >> :"r"(m)); //m is an array > > >>} > > > > > > You forgot a closing quote. > > > > And a \t after the \n. Without it, the second movq would > > start at the beginning of the line and be interpreted as > > a label by the assembler. > > It's not true. It will be interpreted correctly. At least, for the > x86 assembler. OK then, is it because it writes to the output before consuming all the inputs? "Unless an output operand has the '&' constraint modifier, GCC may allocate it in the same register as an unrelated input operand, on the assumption the inputs are consumed before the outputs are produced. This assumption may be false if the assembler code actually consists of more than one instruction. In such a case, use '&' for each output operand that may not overlap an input. See Section 5.36.4 [Modifiers], page 225." cheers, DaveK -- Can't think of a witty .sigline today.... From dk@artimi.com Wed Aug 11 12:47:00 2004 From: dk@artimi.com (Dave Korn) Date: Wed, 11 Aug 2004 12:47:00 -0000 Subject: problem in extended asm In-Reply-To: Message-ID: > -----Original Message----- > From: gcc-owner On Behalf Of Dave Korn > Sent: 11 August 2004 10:03 > > > >>for(i=0;i<8;i++) > > > >>{ > > > >>asm("movq i(%1),%%mm0 \n" > > > >> "movq %%mm0,(%0) > > > >> :"=r"(x) > > > >> :"r"(m)); //m is an array > > > >>} > > OK then, is it because it writes to the output before > consuming all the inputs? D'oh. Not in that non-intel syntax it doesn't. Ignore that last post, please..... cheers, DaveK -- Can't think of a witty .sigline today.... From vibhaakarsharma@yahoo.com Wed Aug 11 14:37:00 2004 From: vibhaakarsharma@yahoo.com (Vibhaakar Sharma) Date: Wed, 11 Aug 2004 14:37:00 -0000 Subject: Steps required for gcc compilation.. Message-ID: <20040811102652.14257.qmail@web40601.mail.yahoo.com> Hi, I am new to compiling gcc. Can anyone point me what are exact steps to compile gcc my-self. What is difference while cross-compiling it for AMD64/IA64. And which library/component is responsible for generating format i.e. ELF or PE-COFF. Thanks, -Vibhaakar. __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail From eljay@adobe.com Wed Aug 11 18:45:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Wed, 11 Aug 2004 18:45:00 -0000 Subject: Steps required for gcc compilation.. References: <20040811102652.14257.qmail@web40601.mail.yahoo.com> Message-ID: <017401c47fa1$4a9e3140$6eb2f882@PS253> Hi Vibhaakar, > I am new to compiling gcc. Can anyone point me what are exact steps to compile gcc my-self. http://gcc.gnu.org/install/ > What is difference while cross-compiling it for AMD64/IA64. I do not know. > And which library/component is responsible for generating format i.e. ELF or PE-COFF. I do not know. HTH, --Eljay From michal017@centrum.sk Wed Aug 11 19:24:00 2004 From: michal017@centrum.sk (m.) Date: Wed, 11 Aug 2004 19:24:00 -0000 Subject: precompiled headers usage Message-ID: <411A2F0A.2020505@centrum.sk> How do I know whether a precompiled header was used during compilation of a .cc unit? I used -H switch but it was not listed, however the original header file that was used to generate the .h.gch precompiled header was there.. thanks. m. From zzz@anda.ru Wed Aug 11 19:28:00 2004 From: zzz@anda.ru (Denis Zaitsev) Date: Wed, 11 Aug 2004 19:28:00 -0000 Subject: problem in extended asm In-Reply-To: ; from schwab@suse.de on Wed, Aug 11, 2004 at 02:13:09AM +0200 References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> <16665.17765.539593.671110@gargle.gargle.HOWL> Message-ID: <20040812003440.B615@natasha.ward.six> On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: > Paul Koning writes: > > > The same goes for many other assemblers. It depends on the syntax > > rules -- some assemblers believe that a token in column 1 is a label, > > some believe a token must be followed by colon (and often doesn't have > > to be in column 1) to be a label. GAS appears to be one such. > > Unless it is used in MRI-compatibility mode. What does MRI stand for? From tm_gccmail@kloo.net Wed Aug 11 20:32:00 2004 From: tm_gccmail@kloo.net (tm_gccmail@kloo.net) Date: Wed, 11 Aug 2004 20:32:00 -0000 Subject: problem in extended asm In-Reply-To: <20040812003440.B615@natasha.ward.six> Message-ID: On Thu, 12 Aug 2004, Denis Zaitsev wrote: > On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: > > Paul Koning writes: > > > > > The same goes for many other assemblers. It depends on the syntax > > > rules -- some assemblers believe that a token in column 1 is a label, > > > some believe a token must be followed by colon (and often doesn't have > > > to be in column 1) to be a label. GAS appears to be one such. > > > > Unless it is used in MRI-compatibility mode. > > What does MRI stand for? I believe it's Microtec Research, Inc. Toshi From schwab@suse.de Wed Aug 11 20:34:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Wed, 11 Aug 2004 20:34:00 -0000 Subject: problem in extended asm In-Reply-To: <20040812003440.B615@natasha.ward.six> (Denis Zaitsev's message of "Thu, 12 Aug 2004 00:34:40 +0600") References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> <16665.17765.539593.671110@gargle.gargle.HOWL> <20040812003440.B615@natasha.ward.six> Message-ID: Denis Zaitsev writes: > On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: >> Paul Koning writes: >> >> > The same goes for many other assemblers. It depends on the syntax >> > rules -- some assemblers believe that a token in column 1 is a label, >> > some believe a token must be followed by colon (and often doesn't have >> > to be in column 1) to be a label. GAS appears to be one such. >> >> Unless it is used in MRI-compatibility mode. > > What does MRI stand for? *Note (as)M:: The `-M' or `--mri' option selects MRI compatibility mode. This changes the syntax and pseudo-op handling of `as' to make it compatible with the `ASM68K' or the `ASM960' (depending upon the configured target) assembler from Microtec Research. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From zzz@anda.ru Thu Aug 12 03:06:00 2004 From: zzz@anda.ru (Denis Zaitsev) Date: Thu, 12 Aug 2004 03:06:00 -0000 Subject: problem in extended asm In-Reply-To: ; from schwab@suse.de on Wed, Aug 11, 2004 at 09:28:47PM +0200 References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> <16665.17765.539593.671110@gargle.gargle.HOWL> <20040812003440.B615@natasha.ward.six> Message-ID: <20040812023237.B853@natasha.ward.six> On Wed, Aug 11, 2004 at 09:28:47PM +0200, Andreas Schwab wrote: > Denis Zaitsev writes: > > > On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: > >> Paul Koning writes: > >> > >> > The same goes for many other assemblers. It depends on the syntax > >> > rules -- some assemblers believe that a token in column 1 is a label, > >> > some believe a token must be followed by colon (and often doesn't have > >> > to be in column 1) to be a label. GAS appears to be one such. > >> > >> Unless it is used in MRI-compatibility mode. > > > > What does MRI stand for? > > *Note (as)M:: > > The `-M' or `--mri' option selects MRI compatibility mode. This changes > the syntax and pseudo-op handling of `as' to make it compatible with the > `ASM68K' or the `ASM960' (depending upon the configured target) > assembler from Microtec Research. Ok. Thanks. From zzz@anda.ru Thu Aug 12 03:32:00 2004 From: zzz@anda.ru (Denis Zaitsev) Date: Thu, 12 Aug 2004 03:32:00 -0000 Subject: problem in extended asm In-Reply-To: ; from tm_gccmail@kloo.net on Wed, Aug 11, 2004 at 12:09:54PM -0700 References: <20040812003440.B615@natasha.ward.six> Message-ID: <20040812023433.C853@natasha.ward.six> On Wed, Aug 11, 2004 at 12:09:54PM -0700, tm_gccmail@kloo.net wrote: > On Thu, 12 Aug 2004, Denis Zaitsev wrote: > > > On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: > > > Paul Koning writes: > > > > > > > The same goes for many other assemblers. It depends on the syntax > > > > rules -- some assemblers believe that a token in column 1 is a label, > > > > some believe a token must be followed by colon (and often doesn't have > > > > to be in column 1) to be a label. GAS appears to be one such. > > > > > > Unless it is used in MRI-compatibility mode. > > > > What does MRI stand for? > > I believe it's Microtec Research, Inc. Thanks. Andreas have described that it really is. From oliver.george@dhhs.tas.gov.au Thu Aug 12 06:03:00 2004 From: oliver.george@dhhs.tas.gov.au (George Oliver) Date: Thu, 12 Aug 2004 06:03:00 -0000 Subject: best way to construct function calls at runtime? Message-ID: <76961E0EB74CE84CBA46259D2182B147030D9DC1@pc1935.dchs.tas.gov.au> Hello, What is the best way to construct function calls at runtime? I'm writing an interpreted language and want to access system/dynamic libraries. Dlsym gives me a function pointer and I have runtime declarations identifying the function arguments. But what is the right way to invoke the call? The ideal seems to be some kind of gcc library which will help me call functions based on runtime interface declarations - perhaps I'm overly hopeful but does such a beast exist? Below are the things I've experimented with, all work on x86 but have limitations and are unlikely to be very cross platform friendly. cheers, Oliver. INLINE ASSEMBLER ==================== Using inline assembly instructions (PUSH, CALL, MOV, STL) to put args on the stack, call the function and retrieve scalar or floating-point result. CON: Works great on x86 but for other processors it looks a lot more scary. CON: More complicated to handle functions returning struct/union types ALL POSSIBLE COMBINATIONS ================================ Since args are boundary aligned I could do what most other interpreters I've found do, do a switch for argcount and make a generic call for every possibility. Something like this... void** buf[siz]; //populated with vals (note that a double will fill two words) switch (siz) { case 0: res=fn(); break; case 0: res=fn(buf[0]); break; case 0: res=fn(buf[0],buf[1]); break; case 0: res=fn(buf[0],buf[1],buf[2]); break; // et al. } CON: have to repeat for different result types (scalar vs double vs struct/union) CON: seems like there should be a better way From chaoliu@uiuc.edu Thu Aug 12 06:09:00 2004 From: chaoliu@uiuc.edu (Chao Liu) Date: Thu, 12 Aug 2004 06:09:00 -0000 Subject: how to dumping out function name and its parameters from gcc's AST? Message-ID: Hi, hackers, I am now try to dump our AST from gcc 3.4.0 for c programming language. Currently, I'd like to dump out the function name and its parameters if any. For example, for a function call to the function foo like "foo(a, b, c)" , I would like "foo, a, b, c" dumped out. My instrumented code into gcc's c-decl.c is switch (TREE_CODE(expr)){ case CALL_EXPR: printf("%s", IDENTIFIER_POINTER(DECL_NAME(TREE_OPERAND(expr, 0), 0)))); tree paralist = TREE_VALUE(TREE_OPERAND(expr, 1)); tree para = TREE_CHAIN(paralist); while(para != NULL_TREE){ printf("%s", IDENTIFIER_POINTER(DECL_NAME(para))); para = TREE_CHAIN(para); } but it failed to give the correct parameter names while function name is correct. So what's wrong? I know in cases like foo(i+j, p+q), it is undefined what to dump out but just want to know in the simple case foo(i, j) how to dump foo, i, j if possible. btw, for an expression "expr" with TREE_CODE as CALL_EXPR, what is the type of TREE_OPERAND(expr, 0) and TREE_OPERAND(expr, 1); As documented in tree.def, they are function and paralist, but what are their TREE_CODES? Also, given one tree type variable, like tree tmp, how can I know its TREE_CODE? Do we have some methods to print its type out? many thanks to your patience. If you are not clear about what I mean, do let me know. thanks again, Chao From sriharsha.v@redpinesignals.com Thu Aug 12 06:38:00 2004 From: sriharsha.v@redpinesignals.com (Sriharsha Vedurmudi) Date: Thu, 12 Aug 2004 06:38:00 -0000 Subject: Seeking Guidence on Porting GCC Message-ID: <411B0A2F.7050500@redpinesignals.com> Hi, I am from a company where we have developed a new DSP-type Processor and plan to port an RTOS onto it for use with some wireless Stuff. For this, we wanted to port the GCC toolchain for our processor. We have outsourced it to another company and now, I am made incharge of it from the time it is delivered to us (means, I'd be responsible to fix any bugs that arise at later date and provide customer support for the same). Problem: I have never worked at Sub-Compiler level. Im very comfortable with C and some popular command line options of gcc and ld. Nothing much more than that (plus ofcourse using some utilities like nm etc etc). I would like some guidence from a good samaritan on the aspects of Porting GCC toolchain (What part of the entire code needs to be changed? What are the pitfalls to watch for when I receive the ported version? etc...). What I have Done: I have been Bugging Mr. Google for information regarding this, but somehow the results were not satisfactory. Then I tried looking at the source code and decided against it when my deadline arrived. Now, Im really stuck and desperately need help. Thank you in advance for any help you extend. (I'd greatly appreciate if you can atleast provide me with some links that might be useful or serve as a guide). Warm Regards, Sriharsha. -- Sriharsha Vedurmudi Software Engineer Redpine Signals Inc. ---------------------------- Gate No:395, Plot No: 87&88 Sagar Society, Road No: 2 Banjara Hills Hyderabad-500 034 Andhra Pradesh India. ---------------------------- Phone: +91 40 23550722 Mobile: +91 98491 33133 From sriharsha.v@redpinesignals.com Thu Aug 12 10:35:00 2004 From: sriharsha.v@redpinesignals.com (Sriharsha Vedurmudi) Date: Thu, 12 Aug 2004 10:35:00 -0000 Subject: Help Needed On Porting Issue Message-ID: <411B0BBE.60808@redpinesignals.com> Hi, I am from a company where we have developed a new DSP-type Processor and plan to port an RTOS onto it for use with some wireless Stuff. For this, we wanted to port the GCC toolchain for our processor. We have outsourced it to another company and now, I am made incharge of it from the time it is delivered to us (means, I'd be responsible to fix any bugs that arise at later date and provide customer support for the same). Problem: I have never worked at Sub-Compiler level. Im very comfortable with C and some popular command line options of gcc and ld. Nothing much more than that (plus ofcourse using some utilities like nm etc etc). I would like some guidence from a good samaritan on the aspects of Porting GCC toolchain (What part of the entire code needs to be changed? What are the pitfalls to watch for when I receive the ported version? etc...). What I have Done: I have been Bugging Mr. Google for information regarding this, but somehow the results were not satisfactory. Then I tried looking at the source code and decided against it when my deadline arrived. Now, Im really stuck and desperately need help. Thank you in advance for any help you extend. (I'd greatly appreciate if you can atleast provide me with some links that might be useful or serve as a guide). Warm Regards, Sriharsha. -- Sriharsha Vedurmudi Software Engineer Redpine Signals Inc. ---------------------------- Gate No:395, Plot No: 87&88 Sagar Society, Road No: 2 Banjara Hills Hyderabad-500 034 Andhra Pradesh India. ---------------------------- Phone: +91 40 23550722 Mobile: +91 98491 33133 From hueffner@informatik.uni-tuebingen.de Thu Aug 12 12:06:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Thu, 12 Aug 2004 12:06:00 -0000 Subject: best way to construct function calls at runtime? In-Reply-To: <76961E0EB74CE84CBA46259D2182B147030D9DC1@pc1935.dchs.tas.gov.au> (George Oliver's message of "Thu, 12 Aug 2004 13:00:39 +1000") References: <76961E0EB74CE84CBA46259D2182B147030D9DC1@pc1935.dchs.tas.gov.au> Message-ID: <87u0v8c13g.fsf@informatik.uni-tuebingen.de> George Oliver writes: > What is the best way to construct function calls at runtime? You can use libffi, which is part of gcc's source. It is not ported to all gcc platforms, but to most important ones. -- Falk From david@krt.neobee.net Thu Aug 12 16:16:00 2004 From: david@krt.neobee.net (Mile Davidovic) Date: Thu, 12 Aug 2004 16:16:00 -0000 Subject: Question regarding subscribing Message-ID: <000e01c48058$1330d020$5900a8c0@micronasnit.com> Hi all Please could You tell why I can not to subscribe to gcc mailing list? I tried with Mile.Davidovic@micronasnit.com but I failed? Best regards Mile From eljay@adobe.com Thu Aug 12 17:51:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 12 Aug 2004 17:51:00 -0000 Subject: Question regarding subscribing References: <000e01c48058$1330d020$5900a8c0@micronasnit.com> Message-ID: <005d01c48064$c19726d0$67b2f882@PS253> Hi Mile, Did you go here... http://gcc.gnu.org/lists.html ...and register your email address? Do you have a spam filter on your email that consumed the confirmation notice? Is your Mile.Davidovic@micronasnit.com account active? HTH, --Eljay From rs@isctem.com Thu Aug 12 23:04:00 2004 From: rs@isctem.com (Ricardo Santos) Date: Thu, 12 Aug 2004 23:04:00 -0000 Subject: Help with templates Message-ID: <411B97A8.4050607@isctem.com> I have a problem with templates. I am doing a little class (Stack) to demonstrate templates, and I have a library problem. I don't know wich library I have to compile with, to use templates... My compilation line is: g++ -o s StackAr.cpp mStackAr.cpp And the Result of that command is: /home/rs/tmp/cc0KjPdZ.o(.text+0x1c): In function `main': : undefined reference to `StackAr::StackAr[in-charge]()' /home/rs/tmp/cc0KjPdZ.o(.text+0x36): In function `main': : undefined reference to `StackAr::Push(int const&)' /home/rs/tmp/cc0KjPdZ.o(.text+0x50): In function `main': : undefined reference to `StackAr::Push(int const&)' /home/rs/tmp/cc0KjPdZ.o(.text+0x6a): In function `main': : undefined reference to `StackAr::Push(int const&)' /home/rs/tmp/cc0KjPdZ.o(.text+0x84): In function `main': : undefined reference to `StackAr::Pop()' /home/rs/tmp/cc0KjPdZ.o(.text+0xb6): In function `main': : undefined reference to `StackAr::Top() const' /home/rs/tmp/cc0KjPdZ.o(.text+0xe8): In function `main': : undefined reference to `StackAr::Pop()' /home/rs/tmp/cc0KjPdZ.o(.text+0x10f): In function `main': : undefined reference to `StackAr::~StackAr [in-charge]()' /home/rs/tmp/cc0KjPdZ.o(.text+0x12d): In function `main': : undefined reference to `StackAr::~StackAr [in-charge]()' collect2: ld returned 1 exit status I am using Mandrake Linux in x86. Thanks Ricardo From eljay@adobe.com Fri Aug 13 07:41:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 13 Aug 2004 07:41:00 -0000 Subject: Help with templates References: <411B97A8.4050607@isctem.com> Message-ID: <00d301c48094$e5511d30$67b2f882@PS253> Hi Ricardo, It looks like the main function does not have access to the template declaration. Is your template declaration in your StackAr.cpp? Then you'll need #include "StackAr.cpp" for your main, presuming main is located in mStackAr.cpp. Or vice-versa, if I have StackAr.cpp and mStackAr.cpp reversed. HTH, --Eljay From wilson@specifixinc.com Fri Aug 13 11:44:00 2004 From: wilson@specifixinc.com (James E Wilson) Date: Fri, 13 Aug 2004 11:44:00 -0000 Subject: problem in extended asm In-Reply-To: <20040809171020.61634.qmail@web52901.mail.yahoo.com> References: <20040809171020.61634.qmail@web52901.mail.yahoo.com> Message-ID: <411BF761.9030807@specifixinc.com> Ankit Jain wrote: > a simple question: why the followinf instruction > dosent work in gcc > asm("movq i(%1),%%mm0 \n" > "movq %%mm0,(%0) > :"=r"(x) > :"r"(m)); //m is an array Always include a testcase that can be compiled. A program fragment like this is a very poor bug report, as often the bug is in something you left out. In this particular case, the problem is likely that you are using arrays, and register allocation can not assign an array to a register, at least not after you have referenced an element of it. Hence, you can not use an 'r' constraint with an array. Try using a vector type or a union instead of an array. -- Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com From rs@isctem.com Fri Aug 13 11:46:00 2004 From: rs@isctem.com (Ricardo Santos) Date: Fri, 13 Aug 2004 11:46:00 -0000 Subject: Help with templates In-Reply-To: <00d301c48094$e5511d30$67b2f882@PS253> References: <411B97A8.4050607@isctem.com> <00d301c48094$e5511d30$67b2f882@PS253> Message-ID: <411C705F.5060501@isctem.com> Thanks Eljay. Yes, my main is located in mStackAr.cpp. I solved the problem creating an Instancialization file, that only have the folowing lines: #include "StackAr.cpp" template class StackAr; But why do I have to include a .cpp? Cpp's aren't linked??? I am a C guy, that's a little confusing. Ricardo Eljay Love-Jensen wrote: >Hi Ricardo, > >It looks like the main function does not have access to the template >declaration. > >Is your template declaration in your StackAr.cpp? Then you'll need #include >"StackAr.cpp" for your main, presuming main is located in mStackAr.cpp. > >Or vice-versa, if I have StackAr.cpp and mStackAr.cpp reversed. > >HTH, >--Eljay > > > > > From eljay@adobe.com Fri Aug 13 18:47:00 2004 From: eljay@adobe.com (John Love-Jensen) Date: Fri, 13 Aug 2004 18:47:00 -0000 Subject: Help with templates In-Reply-To: <411C705F.5060501@isctem.com> Message-ID: Hi Ricardo, > But why do I have to include a .cpp? Cpp's aren't linked??? I am a C guy, that's a little confusing. >From a C perspective, think of templates as being analogous to #define. What would happen if you did this in these files... ---- foo.h ---- /* Forward declaration */ #define foo ---- end-of-file ---- ---- foo.cpp ---- #define foo 120 ---- end-of-file ---- ---- main.cpp ---- #include "foo.h" int main() { return foo; } ---- end-of-file ---- You'd probably say, "That's not going to work!" And you're right. Same with templates! Templates are much like IN-LANGUAGE (instead of the PREPROCESSOR-BASED) definitions. The part that is "macro'd" in is the template type parameters. As such, the compiler needs to have the whole template (i.e., "macro") in hand to expand it as needed. Before you stress that the template, which can be quite hefty, is going to be replicated in every object file (and it is going to be replicated in every object file!), the linker is designed to strip out duplicates of the template so the final executable (or shared library or whatever) will only have one copy of the INSTANTIATED template. By "INSTANTIATED template", I mean that foo will be a different instantiation from foo, and that foo's code will not be reduced from foo. (Sidenote, there are some templating tricks that allows foo and foo to both reduce... but that's for the Stepanov's of the world to figure out.) However, 50 instances of foo will get reduced down to one instance of foo in the final executable. The above caveat about templates being fully in header files, is also true about inline functions. Inline functions should also be fully specified in the header file in C++. But inline functions don't "reduce", since they are inline, as you would expect with a macro-function #define. Sometimes a function tagged as inline cannot be inlined by the compiler, so in that case multiple copies of the the ersatz inline function will reduce in the final executable. NOTE: I'm glossing over a lot of details. I just want you to get the gist of the template animal in C++, from a C perspective. HTH, --Eljay From dk@artimi.com Fri Aug 13 18:57:00 2004 From: dk@artimi.com (Dave Korn) Date: Fri, 13 Aug 2004 18:57:00 -0000 Subject: problem in extended asm In-Reply-To: <411BF761.9030807@specifixinc.com> Message-ID: > -----Original Message----- > From: gcc-owner On Behalf Of James E Wilson > Sent: 13 August 2004 00:04 > To: Ankit Jain > Ankit Jain wrote: > > a simple question: why the followinf instruction > > dosent work in gcc > > asm("movq i(%1),%%mm0 \n" > > "movq %%mm0,(%0) > > :"=r"(x) > > :"r"(m)); //m is an array > > Always include a testcase that can be compiled. A program > fragment like > this is a very poor bug report, as often the bug is in something you > left out. > > In this particular case, the problem is likely that you are using > arrays, and register allocation can not assign an array to a > register, > at least not after you have referenced an element of it. > Hence, you can > not use an 'r' constraint with an array. > > Try using a vector type or a union instead of an array. ...The other problem being his attempt to smuggle the variable 'i' into the asm. But I'm curious now: doesn't the array reference degenerate to a pointer like it would if you passed it to a function that requires a pointer to whatever type the array is of? Or does it (or should it) follow the (machine and abi)-dependent rules for whether or not small structs are passed byval or reference in the calling convention? cheers, DaveK -- Can't think of a witty .sigline today.... From jmah@caduc.com Fri Aug 13 18:58:00 2004 From: jmah@caduc.com (Joseph Mah) Date: Fri, 13 Aug 2004 18:58:00 -0000 Subject: make gcc errors Message-ID: <013c01c48165$c14bd930$515aa8c0@WNYCCAD105283JM> Hello, I am running AIX 4.3.3. and am using the command: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap towards the end I get an error: make[1]: Entering directory `/gcc/gcc' gcc -g -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing- prot otypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -o genattrt ab \ genattrtab.o genautomata.o \ rtl.o read-rtl.o bitmap.o ggc-none.o min-insn-modes.o gensupport.o insn-conditi ons.o print-rtl1.o errors.o \ varray.o ../libiberty/libiberty.a -lm collect2: library libm not found make[1]: *** [genattrtab] Error 1 make[1]: Leaving directory `/gcc/gcc' make: *** [stage1_build] Error 2 make: *** [bootstrap] Error 2 What does this mean? Can anyone please help me? Thanks for any suggestions and helpful hints From gbras@anacomp.com Fri Aug 13 19:12:00 2004 From: gbras@anacomp.com (Bras, Gerard) Date: Fri, 13 Aug 2004 19:12:00 -0000 Subject: make gcc errors Message-ID: <66911C8E1F2DA24EB29DE289297A135E1FC037@usrd104.corp.anacomp.com> Joseph, What it means is that it's looking for libm.a and not finding it. Ordinarily if this happens it's because your LIBPATH env var is set wrong. I think the xlC ld knows where to look for it so.... which linker are you using? best regards, Gerard Bras -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Joseph Mah Sent: Friday, August 13, 2004 2:46 PM To: gcc-help@gcc.gnu.org Subject: make gcc errors Hello, I am running AIX 4.3.3. and am using the command: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap towards the end I get an error: make[1]: Entering directory `/gcc/gcc' gcc -g -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing- prot otypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -o genattrt ab \ genattrtab.o genautomata.o \ rtl.o read-rtl.o bitmap.o ggc-none.o min-insn-modes.o gensupport.o insn-conditi ons.o print-rtl1.o errors.o \ varray.o ../libiberty/libiberty.a -lm collect2: library libm not found make[1]: *** [genattrtab] Error 1 make[1]: Leaving directory `/gcc/gcc' make: *** [stage1_build] Error 2 make: *** [bootstrap] Error 2 What does this mean? Can anyone please help me? Thanks for any suggestions and helpful hints From wilson@specifixinc.com Fri Aug 13 19:46:00 2004 From: wilson@specifixinc.com (James E Wilson) Date: Fri, 13 Aug 2004 19:46:00 -0000 Subject: problem in extended asm In-Reply-To: References: Message-ID: <1092423493.25668.3.camel@aretha.corp.specifixinc.com> On Fri, 2004-08-13 at 04:44, Dave Korn wrote: > But I'm curious now: doesn't the array reference degenerate to a pointer > like it would if you passed it to a function that requires a pointer to > whatever type the array is of? Either way, it still fails. He was trying to use the value of the array, so if the address got loaded into the register then it would fail at run time. -- Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com From jmah@caduc.com Sat Aug 14 00:53:00 2004 From: jmah@caduc.com (Joseph Mah) Date: Sat, 14 Aug 2004 00:53:00 -0000 Subject: make gcc errors References: <66911C8E1F2DA24EB29DE289297A135E1FC037@usrd104.corp.anacomp.com> Message-ID: <015901c48169$36198d90$515aa8c0@WNYCCAD105283JM> I am not sure what linker I am using, is there a way to find out for sure? running set shows no LIBPATH and _=linker. ------------------------ Joseph, What it means is that it's looking for libm.a and not finding it. Ordinarily if this happens it's because your LIBPATH env var is set wrong. I think the xlC ld knows where to look for it so.... which linker are you using? best regards, Gerard Bras -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Joseph Mah Sent: Friday, August 13, 2004 2:46 PM To: gcc-help@gcc.gnu.org Subject: make gcc errors Hello, I am running AIX 4.3.3. and am using the command: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap towards the end I get an error: make[1]: Entering directory `/gcc/gcc' gcc -g -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing- prot otypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -o genattrt ab \ genattrtab.o genautomata.o \ rtl.o read-rtl.o bitmap.o ggc-none.o min-insn-modes.o gensupport.o insn-conditi ons.o print-rtl1.o errors.o \ varray.o ../libiberty/libiberty.a -lm collect2: library libm not found make[1]: *** [genattrtab] Error 1 make[1]: Leaving directory `/gcc/gcc' make: *** [stage1_build] Error 2 make: *** [bootstrap] Error 2 What does this mean? Can anyone please help me? Thanks for any suggestions and helpful hints From trick@icculus.org Sat Aug 14 02:04:00 2004 From: trick@icculus.org (Gerry) Date: Sat, 14 Aug 2004 02:04:00 -0000 Subject: Creating executable shared libraries ? Message-ID: <200408132145.56429.trick@icculus.org> Hello. I'm trying to create a shared library that can also be executed as a normal executable in Linux (like libc.so), but I've run into some problems. For it to be linkable as a shared library I have to use the -shared option, but that disables any entry point information. Either leaving main in (as a weak symbol) or using the -e option (which seems to be undocumented ?) results in segfaults and such because no libraries seem to be resolved, not even libc. I've tried linking the required libraries statically, but that doesn't seem to work either. Googling didn't turn up anything useful. Does anyone know how to do this properly ? (Please cc any answers to me, as I'm not subscribed to this list.) Thanks, - Gerry From yoobb@earthlink.net Sat Aug 14 02:45:00 2004 From: yoobb@earthlink.net (Bernard Yoo) Date: Sat, 14 Aug 2004 02:45:00 -0000 Subject: assigning character strings to double precision values in DATA statements Message-ID: <5A44D8EC-ED8C-11D8-A8F1-000A95DAD22E@earthlink.net> Hi, I have an old Fortran 77 program that uses DATA statements to assign character strings to variables that have been declared double precision. Many commercial compilers seem to accept this "undocumented" method of assignment, but g77 does not. Is there any way around this? B.Y. From webman.li@utstar.com Sat Aug 14 03:11:00 2004 From: webman.li@utstar.com (webman.li) Date: Sat, 14 Aug 2004 03:11:00 -0000 Subject: a question about shared library Message-ID: <003d01c481a3$66bf6c50$351313ac@cn.utstarcom.com> hi, I have compiled a shared library using G++ on solaris. I use Sun's linker to link this library with other objs and libs that are compiled using SUN's CC compiler.It is failed. Is libs compiled using G++ can not be linked,using SUN's linker, with libs & objs compiled using SUN's CC?? thanks From jeff.holle@verizon.net Sat Aug 14 07:37:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Sat, 14 Aug 2004 07:37:00 -0000 Subject: problem using a custom exception class Message-ID: I'm using gcc v3.4.1. I've a custom exception class which I'm using in a library that compiles without any compiler errors/warnings. When I attempt to use this library, I get: : undefined reference to `typeinfo for attribute_error' My custom exception class, modeled using info from stdexcept, is: class attribute_error : public std::exception { public: explicit attribute_error(const std::string& attributeName) throw(); // used for missing attribute explicit attribute_error(const std::string& attributeName, const std::string& msg) throw(); virtual ~attribute_error() throw() {} virtual const char* what() const throw(); private: std::string msg_; }; Can someone point me to how to fix this? From bdavis@gcc.gnu.org Sat Aug 14 09:30:00 2004 From: bdavis@gcc.gnu.org (Bud Davis) Date: Sat, 14 Aug 2004 09:30:00 -0000 Subject: assigning character strings to double precision values in DATA statements Message-ID: <1092453070.4668.2.camel@localhost.localdomain> Here is an example using hollerith constants: $ cat b.f double precision a(2) data a /8Hred ,8Hblue / print '(2A)',a end $ g77 b.f $ ./a.out red blue Is this what you need ? post a small example of the code in question, it will help us understand exactly what the issue is. Hope this helps, bud davis From uphdufzm@hutchcity.com Sat Aug 14 15:44:00 2004 From: uphdufzm@hutchcity.com (Joy Nicholson) Date: Sat, 14 Aug 2004 15:44:00 -0000 Subject: code# PG-635-T Message-ID: Hi, I sent you an email last week and I'd like to confirm everything now. Please read the info below and let me know if you have any questions. We are accepting your mo:rtgage application. If you have b-ad (c:re dit), it's ok. You can get a $200,000 loan for a $350 per month payment. Approval process will only take 1 minute. Just visit the link below and fill out the short form. Thank You http://wlgteamlender.com/?partid=fbuff123 Best Regards, Manager: Joy Nicholson USA Broker Group Tijuana has a beautiful new home in Colorado- and you can too ! Future options: wlgteamlender.com/st.html From bjg@network-theory.co.uk Sat Aug 14 17:25:00 2004 From: bjg@network-theory.co.uk (Brian Gough) Date: Sat, 14 Aug 2004 17:25:00 -0000 Subject: Help with templates In-Reply-To: Ricardo Santos's message of "Thu, 12 Aug 2004 18:15:36 +0200" References: <411B97A8.4050607@isctem.com> Message-ID: <87pt5u6prj.fsf@network-theory.co.uk> Ricardo Santos writes: > I have a problem with templates. I am doing a little class (Stack) > to demonstrate templates, and I have a library problem. See also p57-61 of the GCC tutorial I published recently (url below). The book is available under the GNU Free Documentation License, with a PDF on the site. -- Brian Gough Network Theory Ltd, Publishing "An Introduction to GCC" -- http://network-theory.co.uk/gcc/intro/ From jeff.holle@verizon.net Sat Aug 14 18:01:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Sat, 14 Aug 2004 18:01:00 -0000 Subject: problem using a custom exception class In-Reply-To: References: Message-ID: An update. I was able to avoid this problem by replacing attribute_error with runtime_error. I don't want to keep my code this way, attribute_error hides use of ostringstring to format a meanful error... So I still would like to know what is wrong with my attribute_error class. Before somebody asks: 1. I did include the implementation of attribute_error in the library. 2. I tried to link all the files of my library instead of using a library. I got the very same results... Jeffrey Holle wrote: > I'm using gcc v3.4.1. > > I've a custom exception class which I'm using in a library that compiles > without any compiler errors/warnings. > > When I attempt to use this library, I get: > : undefined reference to `typeinfo for attribute_error' > > > My custom exception class, modeled using info from stdexcept, is: > > class attribute_error : public std::exception > { > public: > explicit attribute_error(const std::string& attributeName) throw(); // > used for missing attribute > explicit attribute_error(const std::string& attributeName, const > std::string& msg) throw(); > virtual ~attribute_error() throw() {} > virtual const char* what() const throw(); > private: > std::string msg_; > }; > > > Can someone point me to how to fix this? > > From eldering@phys.uu.nl Sat Aug 14 18:11:00 2004 From: eldering@phys.uu.nl (Jaap Eldering) Date: Sat, 14 Aug 2004 18:11:00 -0000 Subject: static link errors with libm Message-ID: <20040814172523.GB19493@a-eskwadraat.nl> Hello, I'm having problems linking statically with the math library. When compiling the following program: #include int main() { sin(0); return 0; } with 'gcc -static -lm -o progname progname.c', I get errors: /tmp/ccZSyXXG.o: In function `main': /tmp/ccZSyXXG.o(.text+0xe): undefined reference to `sin' collect2: ld returned 1 exit status while without the -static option, all is fine. More strangly, if I compile with 'g++ -x c -static -lm -o progname progname.c' then it compiles fine too. I have this problem on Debian stable with gcc 2.95.4 and 3.0.4 and on SunOS with gcc 3.2.2, but not on Compaq Tru64 UNIX V5.1A with gcc 3.4.1 Thanks for any help, Jaap Eldering From ishwar@pali.cps.cmich.edu Sat Aug 14 22:26:00 2004 From: ishwar@pali.cps.cmich.edu (Ishwar Rattan) Date: Sat, 14 Aug 2004 22:26:00 -0000 Subject: static link errors with libm In-Reply-To: <20040814172523.GB19493@a-eskwadraat.nl> References: <20040814172523.GB19493@a-eskwadraat.nl> Message-ID: Try -lm as the last command-line argument to gcc -ishwar On Sat, 14 Aug 2004, Jaap Eldering wrote: > Hello, > > I'm having problems linking statically with the math library. > > When compiling the following program: > > #include > > int main() > { > sin(0); > return 0; > } > > with 'gcc -static -lm -o progname progname.c', I get errors: > > /tmp/ccZSyXXG.o: In function `main': > /tmp/ccZSyXXG.o(.text+0xe): undefined reference to `sin' > collect2: ld returned 1 exit status > > while without the -static option, all is fine. More strangly, if I > compile with 'g++ -x c -static -lm -o progname progname.c' then it > compiles fine too. > > I have this problem on Debian stable with gcc 2.95.4 and 3.0.4 and on > SunOS with gcc 3.2.2, but not on Compaq Tru64 UNIX V5.1A with gcc 3.4.1 > > Thanks for any help, > Jaap Eldering > From eldering@phys.uu.nl Sat Aug 14 23:50:00 2004 From: eldering@phys.uu.nl (Jaap Eldering) Date: Sat, 14 Aug 2004 23:50:00 -0000 Subject: static link errors with libm In-Reply-To: References: <20040814172523.GB19493@a-eskwadraat.nl> Message-ID: <20040814181116.GC19493@a-eskwadraat.nl> On Sat, Aug 14, 2004 at 02:04:48PM -0400, Ishwar Rattan wrote: > Try -lm as the last command-line argument to gcc > -ishwar Ok, this works. Thanks! But why does it have to be last? I'd suppose only the order with respect to -static might matter. Jaap > On Sat, 14 Aug 2004, Jaap Eldering wrote: > > > Hello, > > > > I'm having problems linking statically with the math library. > > > > When compiling the following program: > > > > #include > > > > int main() > > { > > sin(0); > > return 0; > > } > > > > with 'gcc -static -lm -o progname progname.c', I get errors: > > > > /tmp/ccZSyXXG.o: In function `main': > > /tmp/ccZSyXXG.o(.text+0xe): undefined reference to `sin' > > collect2: ld returned 1 exit status > > > > while without the -static option, all is fine. More strangly, if I > > compile with 'g++ -x c -static -lm -o progname progname.c' then it > > compiles fine too. > > > > I have this problem on Debian stable with gcc 2.95.4 and 3.0.4 and on > > SunOS with gcc 3.2.2, but not on Compaq Tru64 UNIX V5.1A with gcc 3.4.1 > > > > Thanks for any help, > > Jaap Eldering > > From larry.brown@dimensionnetworks.com Sun Aug 15 02:08:00 2004 From: larry.brown@dimensionnetworks.com (Larry Brown) Date: Sun, 15 Aug 2004 02:08:00 -0000 Subject: Newbie Hello Message-ID: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> I hope I'm in the right place... I am a fairly accomplished php developer and have written quite a bit of code with it. However, all of my coding experience has been with scripting languages and I have never had to deal with memory allocation and rarely ever dealt with pointers or casting etc. For instance... with scripting I can simply access arguments by referencing the string at argv[1] or ARGV[1] etc. It looks like I should be able to do this with c but I have to reference *argv[x] and *argv[x] only holds the first character. The following is a snippet... int main(int argc, *argv[]) { int secondVar=*argv[2]; } if the second argument is say ... 10, I only get the 1. There is some logic that I must follow that I can't see. I've tried looking at *argv[2][0] to see if it was one and *argv[2][1] was zero but is aparently not the case. I have looked at several howto/instruction documents and none seem to yeild much. TIA Again, I hope I'm in the right place... Larry From ishwar@pali.cps.cmich.edu Sun Aug 15 09:30:00 2004 From: ishwar@pali.cps.cmich.edu (Ishwar Rattan) Date: Sun, 15 Aug 2004 09:30:00 -0000 Subject: Newbie Hello In-Reply-To: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> References: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> Message-ID: Locate a basic C programming txt and read it carefully or stick with scripting.. -ishwar On Sat, 14 Aug 2004, Larry Brown wrote: > I hope I'm in the right place... I am a fairly accomplished php > developer and have written quite a bit of code with it. However, all of > my coding experience has been with scripting languages and I have never > had to deal with memory allocation and rarely ever dealt with pointers > or casting etc. > > For instance... > > with scripting I can simply access arguments by referencing the string > at argv[1] or ARGV[1] etc. It looks like I should be able to do this > with c but I have to reference *argv[x] and *argv[x] only holds the > first character. The following is a snippet... > > int main(int argc, *argv[]) > { > int secondVar=*argv[2]; > } > > if the second argument is say ... 10, I only get the 1. There is some > logic that I must follow that I can't see. I've tried looking at > *argv[2][0] to see if it was one and *argv[2][1] was zero but is > aparently not the case. > > I have looked at several howto/instruction documents and none seem to > yeild much. > > TIA > > Again, I hope I'm in the right place... > > Larry > From jeff.holle@verizon.net Sun Aug 15 16:57:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Sun, 15 Aug 2004 16:57:00 -0000 Subject: Newbie Hello In-Reply-To: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> References: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> Message-ID: The thing that you need to know about the difference between a scripting language and C/C++ is that the later is strongly typed. This means that you basically need to know what these types are and what can and can't be auto converted. In your case, you are treating a *char as an int. If you are using C++, the most eligant way to do this is via boost::lexical_cast. In C, there are more primative facilities. Look for atoi documentation. Larry Brown wrote: > I hope I'm in the right place... I am a fairly accomplished php > developer and have written quite a bit of code with it. However, all of > my coding experience has been with scripting languages and I have never > had to deal with memory allocation and rarely ever dealt with pointers > or casting etc. > > For instance... > > with scripting I can simply access arguments by referencing the string > at argv[1] or ARGV[1] etc. It looks like I should be able to do this > with c but I have to reference *argv[x] and *argv[x] only holds the > first character. The following is a snippet... > > int main(int argc, *argv[]) > { > int secondVar=*argv[2]; > } > > if the second argument is say ... 10, I only get the 1. There is some > logic that I must follow that I can't see. I've tried looking at > *argv[2][0] to see if it was one and *argv[2][1] was zero but is > aparently not the case. > > I have looked at several howto/instruction documents and none seem to > yeild much. > > TIA > > Again, I hope I'm in the right place... > > Larry > > From bjg@network-theory.co.uk Sun Aug 15 17:56:00 2004 From: bjg@network-theory.co.uk (Brian Gough) Date: Sun, 15 Aug 2004 17:56:00 -0000 Subject: static link errors with libm In-Reply-To: Jaap Eldering's message of "Sat, 14 Aug 2004 20:11:16 +0200" References: <20040814172523.GB19493@a-eskwadraat.nl> <20040814181116.GC19493@a-eskwadraat.nl> Message-ID: <87vffkeol9.fsf@network-theory.co.uk> Jaap Eldering writes: > On Sat, Aug 14, 2004 at 02:04:48PM -0400, Ishwar Rattan wrote: > > Try -lm as the last command-line argument to gcc > > -ishwar > > Ok, this works. Thanks! > > But why does it have to be last? I'd suppose only the order with respect > to -static might matter. Object files and libraries are searched from left-to-right so the sin() function is not picked up when -lm appears first. In C, the math library is separate from the main standard library for historical reasons. In C++ you don't need a separate -lm so the g++ command works on its own. -- Brian Gough Network Theory Ltd, Publishing "An Introduction to GCC" --- http://network-theory.co.uk/gcc/intro/ From stuart.191@ntlworld.com Mon Aug 16 06:20:00 2004 From: stuart.191@ntlworld.com (stuart macgregor) Date: Mon, 16 Aug 2004 06:20:00 -0000 Subject: djgpp and cygwin gcc do not have complex.h, but gcc on linux does? Message-ID: <200408151757.17143.stuart.191@ntlworld.com> I would like to compile the nec2c program with a dos/windows target (a command line file in -> file out program). It includes complex.h, which allows it to do complex maths on a unix gcc (a c99 extension?), but it and associated files seem to be missing on the djgpp and cygwin distributions. Is there something I can download to fix this? From nutrina9@yahoo.de Mon Aug 16 08:28:00 2004 From: nutrina9@yahoo.de (=?iso-8859-1?q?Gerald=20Iakobinyi=20Pich?=) Date: Mon, 16 Aug 2004 08:28:00 -0000 Subject: help installing gcc 2.95.3 Message-ID: <20040815175558.29226.qmail@web50104.mail.yahoo.com> Hello I would like to install gcc 1.95.3 on my FreeBSD system (now I have gcc 3.3.3 but I need gcc 1.95.3 for testing some progs). This is what I did: # mkdir gcc_obj # cd gcc_obj # ../gcc-2.95.3/configure until here everything seems to have gone just fine. Then I run: # make bootstrap And this is what I get: nutrina# make bootstrap if [ x"no" = xyes ] && [ ! -d pic ]; then mkdir pic; else true; fi touch stamp-picdir test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/argv.c -o pic/argv.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/argv.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/choose-temp.c -o pic/choose-temp.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/choose-temp.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/concat.c -o pic/concat.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/concat.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/cplus-dem.c -o pic/cplus-dem.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/cplus-dem.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/fdmatch.c -o pic/fdmatch.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/fdmatch.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/fnmatch.c -o pic/fnmatch.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/fnmatch.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getopt.c -o pic/getopt.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getopt.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getopt1.c -o pic/getopt1.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getopt1.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getruntime.c -o pic/getruntime.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getruntime.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/hex.c -o pic/hex.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/hex.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/floatformat.c -o pic/floatformat.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/floatformat.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/objalloc.c -o pic/objalloc.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/objalloc.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/obstack.c -o pic/obstack.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/obstack.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/pexecute.c -o pic/pexecute.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/pexecute.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/spaces.c -o pic/spaces.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/spaces.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/splay-tree.c -o pic/splay-tree.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/splay-tree.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/strerror.c -o pic/strerror.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/strerror.c ../../gcc-2.95.3/libiberty/strerror.c:465: error: conflicting types for `sys_nerr' /usr/include/stdio.h:347: error: previous declaration of `sys_nerr' *** Error code 1 Stop in /root/private/gcc/gcc_obj/libiberty. *** Error code 1 Stop in /root/private/gcc/gcc_obj. Could somebody please help me out ??? Best Regards, Gerald ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de From webman.li@utstar.com Mon Aug 16 11:02:00 2004 From: webman.li@utstar.com (webman.li) Date: Mon, 16 Aug 2004 11:02:00 -0000 Subject: a question about shared library Message-ID: <000e01c48359$6b67cfb0$351313ac@cn.utstarcom.com> hi, I have compiled a shared library using g++ on solaris. I use Sun's linker to link this library with other objs and libs that are compiled by SUN's CC compiler.It is failed. Are libs compiled using g++ can not be linked,using SUN's linker, with libs & objs compiled by SUN's CC?? thanks From arno.wilhelm@profile.co.at Mon Aug 16 11:26:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Mon, 16 Aug 2004 11:26:00 -0000 Subject: Newbie Hello In-Reply-To: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> References: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> Message-ID: <1092644910.2694.4.camel@dione.profile.co.at> On Sun, 2004-08-15 at 00:30, Larry Brown wrote: > I hope I'm in the right place... I am a fairly accomplished php > developer and have written quite a bit of code with it. However, all of > my coding experience has been with scripting languages and I have never > had to deal with memory allocation and rarely ever dealt with pointers > or casting etc. > > For instance... > > with scripting I can simply access arguments by referencing the string > at argv[1] or ARGV[1] etc. It looks like I should be able to do this > with c but I have to reference *argv[x] and *argv[x] only holds the > first character. The following is a snippet... > > int main(int argc, *argv[]) > { > int secondVar=*argv[2]; > } > > if the second argument is say ... 10, I only get the 1. There is some > logic that I must follow that I can't see. I've tried looking at > *argv[2][0] to see if it was one and *argv[2][1] was zero but is > aparently not the case. > > I have looked at several howto/instruction documents and none seem to > yeild much. > > TIA > > Again, I hope I'm in the right place... > > Larry Try this: main.c: ------- 1 #include 2 #include 3 4 int main( int argc, char * argv[] ) 5 { 6 7 char * stringVar = argv[1]; 8 printf( "stringVar = %s\n", stringVar ); 9 int numberVar = atoi( stringVar ); 10 printf( "numberVar = %d\n", numberVar ); 11 12 13 return 0; 14 } > gcc -g -Wall -o args main.c > ./args 10 stringVar = 10 numberVar = 10 > -- Arno Wilhelm proFILE Computersysteme GmbH From SMcGarry@acadinfo.co.uk Mon Aug 16 15:28:00 2004 From: SMcGarry@acadinfo.co.uk (McGarry, Simon) Date: Mon, 16 Aug 2004 15:28:00 -0000 Subject: Error Compiling gcc 4.3.1 on AIX 4.3.3 Message-ID: <2D7E4B95F631D711A7A5000802F0140901657D5D@holly.academy.co.uk> Hi all, I've run a Configure and then make bootstrap with LDFLAGS set to "-Wl,-bbigtoc" in the Makefile. These ran successfully but when I did a make install I got the following errors: /bin/sh ../libtool --tag CXX --mode=link /usr/gnu/smc/src/build-gcc/gcc/xgcc -shared-libgcc -B/usr/gnu/smc/src/build-gcc/gcc/ -nostdinc++ -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src /.libs -B/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/bin/ -B/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/lib/ -isystem /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/include -isystem /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/sys-include -pthread -Wl,-O1 -Wl,-G -fno-implicit-templates -Wall -W -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -pthread -o libstdc++.la -rpath /usr/gnu/smc/lib/pthread -version-info 6:1:0 -Wl,--version-script=libstdc++-symbol.ver -lm allocator.lo codecvt.lo complex_io.lo ctype.lo debug.lo debug_list.lo functexcept.lo globals_locale.lo globals_io.lo ios.lo ios_failure.lo ios_init.lo ios_locale.lo limits.lo list.lo locale.lo locale_init.lo locale_facets.lo localename.lo stdexcept.lo strstream.lo tree.lo allocator-inst.lo concept-inst.lo fstream-inst.lo ext-inst.lo io-inst.lo istream-inst.lo locale-inst.lo locale-misc-inst.lo misc-inst.lo ostream-inst.lo sstream-inst.lo streambuf-inst.lo string-inst.lo valarray-inst.lo wlocale-inst.lo wstring-inst.lo atomicity.lo codecvt_members.lo collate_members.lo ctype_members.lo messages_members.lo monetary_members.lo numeric_members.lo time_members.lo basic_file.lo c++locale.lo ../libmath/libmath.la ../libsupc++/libsupc++convenience.la -lm generating symbol list for `libstdc++.la' /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/bin/nm -B -X32_64 -Bpg .libs/allocator.o .libs/codecvt.o .libs/complex_io.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/globals_locale.o .libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/locale-inst.o .libs/locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-inst.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .libs/c++locale.o ../libmath/.libs/libmath.a ../libsupc++/.libs/libsupc++convenience.a | awk '{ if ((($2 == "T") || ($2 == "D") || ($2 == "B")) && (substr($3,1,1) != ".")) { print $3 } }' | sort -u > .libs/libstdc++.exp /usr/gnu/smc/src/build-gcc/gcc/xgcc -shared-libgcc -B/usr/gnu/smc/src/build-gcc/gcc/ -nostdinc++ -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src /.libs -B/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/bin/ -B/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/lib/ -isystem /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/include -isystem /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/sys-include -pthread -shared -o .libs/libstdc++.so.6 .libs/allocator.o .libs/codecvt.o .libs/complex_io.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/globals_locale.o .libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/locale-inst.o .libs/locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-inst.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .libs/c++locale.o -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src /.libs -lm ../libmath/.libs/libmath.a -lm ../libsupc++/.libs/libsupc++convenience.a -lm -L/usr/gnu/smc/src/build-gcc/gcc/pthread -L/usr/gnu/smc/src/build-gcc/gcc -L/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/bin -L/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/lib -L/usr/gnu/smc/lib/../powerpc-ibm-aix4.3.3.0/lib -L/usr/gnu/smc/lib -lgcc_s_pthread -L/usr/lib/threads -lpthreads -lc_r -lgcc_s_pthread -lm -lgcc_s_pthread -lpthreads -lc_r -lgcc_s_pthread -lc -Wl,-O1 -Wl,-G -Wl,--version-script=libstdc++-symbol.ver -Wl,-bE:.libs/libstdc++.exp -Wl,-bnoentry ${wl}-berok .libs/codecvt.o(.tc+0x0):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecvt .cc: undefined reference to `vtable for std::__codecvt_abstract_base' .libs/codecvt.o(.tc+0x0):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecvt .cc: undefined reference to `vtable for std::__codecvt_abstract_base' .libs/codecvt.o(.rw+0x2c):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecv t.cc: undefined reference to `vtable for __cxxabiv1::__si_class_type_info' .libs/codecvt.o(.rw+0x34):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecv t.cc: undefined reference to `typeinfo for std::__codecvt_abstract_base' .libs/codecvt.o(.rw+0x64):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecv t.cc: undefined reference to `vtable for __cxxabiv1::__si_class_type_info' .libs/codecvt.o(.rw+0x6c):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecv t.cc: undefined reference to `typeinfo for std::__codecvt_abstract_base' .libs/complex_io.o(.pr+0x20): In function `.std::basic_istream >& std::operator>> >(std::basic_istream >&, std::complex&)': ------ SNIP There were a huge amout of "undefined reference to" errors, it eventually failed with: collect2: ld returned 1 exit status make[4]: *** [abi_check] Error 1 make[4]: Leaving directory `/_/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/te stsuite' make[3]: *** [install-recursive] Error 1 make[3]: Leaving directory `/_/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3' make[2]: *** [multi-do] Error 1 make[2]: Leaving directory `/_/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/libstdc++-v3' make[1]: *** [install-multi] Error 2 make[1]: Leaving directory `/_/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/libstdc++-v3' make: *** [install-target-libstdc++-v3] Error 2 Can anyone offer some help? Thanks Simon McGarry Technical Consultant Capita Software Services 0870 1631834 simon.mcgarry@capita.co.uk --------------------------------------------------------------------- This Email is confidential and may also be privileged. If you are not the intended recipient, please notify the sender IMMEDIATELY; you should not copy the email or use it for any purpose or disclose its contents to any other person. Any statements made, or intentions expressed in this communication may not necessarily reflect the view of the Capita Group and that the content herein may not be held binding upon the Capita Group or any associated company. ---------------------------------------------------------------------- From eljay@adobe.com Mon Aug 16 15:41:00 2004 From: eljay@adobe.com (John Love-Jensen) Date: Mon, 16 Aug 2004 15:41:00 -0000 Subject: a question about shared library In-Reply-To: <000e01c48359$6b67cfb0$351313ac@cn.utstarcom.com> Message-ID: Hi, >Are libs compiled using g++ can not be linked,using SUN's linker, with libs & objs compiled by SUN's CC?? Correct. Use GNU's binutil's linker "ld". HTH, --Eljay From petsku86@welho.com Mon Aug 16 16:30:00 2004 From: petsku86@welho.com (petsku86@welho.com) Date: Mon, 16 Aug 2004 16:30:00 -0000 Subject: Optimized code with GCC-3.3.3 Message-ID: <1092670127.4120d2af702b0@webmail.welho.com> Hi! I am trying to optimize to code produced by gcc-3.3.3 for my pentium4. After reading the following manual page a got a little confused. http://tinyurl.com/5zt9b Does -march=cpu-type mean that a I automaticly have also -mcpu or do I have to specify them both to get the best possible code? Imply is a verb which when translated to my language (Finnish) could mean that it comes automaticly or it needs to be specified. I tried using google but I didn't get any answers there because I saw the -march option used both with and without -mcpu. Thanks in advance. Regards, Petteri R??ty From segher@kernel.crashing.org Mon Aug 16 16:44:00 2004 From: segher@kernel.crashing.org (Segher Boessenkool) Date: Mon, 16 Aug 2004 16:44:00 -0000 Subject: Creating executable shared libraries ? In-Reply-To: <200408132145.56429.trick@icculus.org> References: <200408132145.56429.trick@icculus.org> Message-ID: > Hello. I'm trying to create a shared library that can also be executed > as a > normal executable in Linux (like libc.so), but I've run into some > problems. See http://gcc.gnu.org/ml/gcc-help/2003-07/msg00232.html . Segher From lrtaylor@micron.com Mon Aug 16 17:04:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Mon, 16 Aug 2004 17:04:00 -0000 Subject: a question about shared library Message-ID: <363801FFD7B74240A329CEC3F7FE4CC4030960B5@ntxboimbx07.micron.com> Actually, the problem is probably due to the fact that he is using two different compilers (g++ and CC) than because he's using Sun's linker. C++ code compiled with g++ is not compatible with C++ code compiled with Sun's compilers. The linker you use can make a difference, but I don't think that's your problem in this case. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of John Love-Jensen Sent: Monday, August 16, 2004 5:16 AM To: webman.li; gcc-help@gcc.gnu.org Subject: Re: a question about shared library Hi, >Are libs compiled using g++ can not be linked,using SUN's linker, with libs & objs compiled by SUN's CC?? Correct. Use GNU's binutil's linker "ld". HTH, --Eljay From lrtaylor@micron.com Mon Aug 16 17:14:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Mon, 16 Aug 2004 17:14:00 -0000 Subject: Newbie Hello Message-ID: <363801FFD7B74240A329CEC3F7FE4CC40215DBB7@ntxboimbx07.micron.com> Larry, Ishwar, while rude(!), has a good point that you should get a good beginners book on C or C++ programming. For C, I might recommend "The C Programming Language" by Kernighan and Ritchie. While not a beginners book, it's a good, concise reference to the language suitable for experienced developers. The reason for this recommendation is that C and C++ handle things like strings much differently than scripting languages do, and you need to understand how this works in order to be able to effectively use them. In this case, what's really happening is that your command line arguments are being passed into your main function in an array of strings (C-style strings - that is, character arrays), where each array element of argv is a pointer that points to the first character of that null-terminated string. So, argv[0] points to the first character of the first argument. Adding the dereference operator dereferences that pointer and returns that first character. To use the whole string, you would pass the pointer to that string to functions that can manipulate strings. For example, if you are expecting a number, you can use the atoi function (ASCII to integer) like this: int num = atoi(argv[1]); Doing something like *argv[1] will return the first character of that argument. If the user entered '10', then it would return the ASCII character for '1', not the value 1. Hope this helps a bit. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Larry Brown Sent: Saturday, August 14, 2004 4:30 PM To: gcc-help@gcc.gnu.org Subject: Newbie Hello I hope I'm in the right place... I am a fairly accomplished php developer and have written quite a bit of code with it. However, all of my coding experience has been with scripting languages and I have never had to deal with memory allocation and rarely ever dealt with pointers or casting etc. For instance... with scripting I can simply access arguments by referencing the string at argv[1] or ARGV[1] etc. It looks like I should be able to do this with c but I have to reference *argv[x] and *argv[x] only holds the first character. The following is a snippet... int main(int argc, *argv[]) { int secondVar=*argv[2]; } if the second argument is say ... 10, I only get the 1. There is some logic that I must follow that I can't see. I've tried looking at *argv[2][0] to see if it was one and *argv[2][1] was zero but is aparently not the case. I have looked at several howto/instruction documents and none seem to yeild much. TIA Again, I hope I'm in the right place... Larry From Rongjun.Lu@cern.ch Mon Aug 16 18:49:00 2004 From: Rongjun.Lu@cern.ch (Rongjun Lu) Date: Mon, 16 Aug 2004 18:49:00 -0000 Subject: problem when building gcc 4.3.0 Message-ID: <3FC7FEE5A901664193468E8F63AFE1EA4D30ED@cernxchg15.cern.ch> Dear Sir: when I build the gcc 4.3.0 for bootloader cross-compiler, the building process failed with pthread errors.Is there any one can tell me why? Thanks. I configured the gcc as following: ../build-gcc/configure --target=arm-linux \ >--prefix=/home/lurj/board_tms5471/tools --without-headers --with-newlib \ >--enable-languages=c then make all-gcc the error are following: ......... arm-linux-ranlib ./libgcov.a /home/lurj/board_tms5471/build-tools/build-gcc/gcc/xgcc -B/home/lurj/board_tms5471/build-tools/build-gcc/gcc/ -B//home/lurj/board_tms5471/tools/arm-linux/bin/ -B//home/lurj/board_tms5471/tools/arm-linux/lib/ -isystem //home/lurj/board_tms5471/tools/arm-linux/include -isystem //home/lurj/board_tms5471/tools/arm-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fomit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-3.4.0/gcc -I../../gcc-3.4.0/gcc/. -I../../gcc-3.4.0/gcc/../include -fexceptions -c ../../gcc-3.4.0/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o In file included from ./gthr-default.h:1, from ../../gcc-3.4.0/gcc/gthr.h:96, from ../../gcc-3.4.0/gcc/unwind-dw2.c:42: ../../gcc-3.4.0/gcc/gthr-posix.h:43:21: pthread.h: No such file or directory ../../gcc-3.4.0/gcc/gthr-posix.h:44:20: unistd.h: No such file or directory In file included from ./gthr-default.h:1, from ../../gcc-3.4.0/gcc/gthr.h:96, from ../../gcc-3.4.0/gcc/unwind-dw2.c:42: ../../gcc-3.4.0/gcc/gthr-posix.h:46: error: parse error before "__gthread_key_t" ../../gcc-3.4.0/gcc/gthr-posix.h:46: warning: type defaults to `int' in declaration of `__gthread_key_t' ../../gcc-3.4.0/gcc/gthr-posix.h:46: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h:47: error: parse error before "__gthread_once_t" ../../gcc-3.4.0/gcc/gthr-posix.h:47: warning: type defaults to `int' in declaration of `__gthread_once_t' ../../gcc-3.4.0/gcc/gthr-posix.h:47: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h:48: error: parse error before "__gthread_mutex_t" ../../gcc-3.4.0/gcc/gthr-posix.h:48: warning: type defaults to `int' in declaration of `__gthread_mutex_t' ../../gcc-3.4.0/gcc/gthr-posix.h:48: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_active_p': ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: `pthread_create' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: (Each undeclared identifier is reported only once ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: for each function it appears in.) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:456: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:456: error: parse error before ')' token ../../gcc-3.4.0/gcc/gthr-posix.h:465: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:465: error: parse error before ')' token ../../gcc-3.4.0/gcc/gthr-posix.h:471: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:472: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_key_delete': ../../gcc-3.4.0/gcc/gthr-posix.h:472: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:473: warning: implicit declaration of function `pthread_key_delete' ../../gcc-3.4.0/gcc/gthr-posix.h:473: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:477: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:478: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_getspecific': ../../gcc-3.4.0/gcc/gthr-posix.h:478: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:479: warning: implicit declaration of function `pthread_getspecific' ../../gcc-3.4.0/gcc/gthr-posix.h:479: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:479: warning: return makes pointer from integer without a cast ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:483: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:484: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_setspecific': ../../gcc-3.4.0/gcc/gthr-posix.h:484: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:485: warning: implicit declaration of function `pthread_setspecific' ../../gcc-3.4.0/gcc/gthr-posix.h:485: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:485: error: `ptr' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:489: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:490: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_lock': ../../gcc-3.4.0/gcc/gthr-posix.h:490: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:492: warning: implicit declaration of function `pthread_mutex_lock' ../../gcc-3.4.0/gcc/gthr-posix.h:492: error: `mutex' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:498: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:499: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_trylock': ../../gcc-3.4.0/gcc/gthr-posix.h:499: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:501: warning: implicit declaration of function `pthread_mutex_trylock' ../../gcc-3.4.0/gcc/gthr-posix.h:501: error: `mutex' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:507: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:508: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_unlock': ../../gcc-3.4.0/gcc/gthr-posix.h:508: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:510: warning: implicit declaration of function `pthread_mutex_unlock' ../../gcc-3.4.0/gcc/gthr-posix.h:510: error: `mutex' undeclared (first use in this function) make[2]: *** [libgcc/./unwind-dw2.o] Error 1 make[2]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make[1]: *** [libgcc.a] Error 2 make[1]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make: *** [all-gcc] Error 2 From lrtaylor@micron.com Mon Aug 16 19:24:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Mon, 16 Aug 2004 19:24:00 -0000 Subject: problem when building gcc 4.3.0 Message-ID: <363801FFD7B74240A329CEC3F7FE4CC4030960BA@ntxboimbx07.micron.com> Have you tried the configure option for disabling thread support? --disable-threads Just a thought - don't know if it will actually help in this case, though... Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Rongjun Lu Sent: Monday, August 16, 2004 11:05 AM To: gcc-help@gcc.gnu.org Subject: problem when building gcc 4.3.0 Dear Sir: when I build the gcc 4.3.0 for bootloader cross-compiler, the building process failed with pthread errors.Is there any one can tell me why? Thanks. I configured the gcc as following: ../build-gcc/configure --target=arm-linux \ >--prefix=/home/lurj/board_tms5471/tools --without-headers --with-newlib \ >--enable-languages=c then make all-gcc the error are following: ......... arm-linux-ranlib ./libgcov.a /home/lurj/board_tms5471/build-tools/build-gcc/gcc/xgcc -B/home/lurj/board_tms5471/build-tools/build-gcc/gcc/ -B//home/lurj/board_tms5471/tools/arm-linux/bin/ -B//home/lurj/board_tms5471/tools/arm-linux/lib/ -isystem //home/lurj/board_tms5471/tools/arm-linux/include -isystem //home/lurj/board_tms5471/tools/arm-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fomit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-3.4.0/gcc -I../../gcc-3.4.0/gcc/. -I../../gcc-3.4.0/gcc/../include -fexceptions -c ../../gcc-3.4.0/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o In file included from ./gthr-default.h:1, from ../../gcc-3.4.0/gcc/gthr.h:96, from ../../gcc-3.4.0/gcc/unwind-dw2.c:42: ../../gcc-3.4.0/gcc/gthr-posix.h:43:21: pthread.h: No such file or directory ../../gcc-3.4.0/gcc/gthr-posix.h:44:20: unistd.h: No such file or directory In file included from ./gthr-default.h:1, from ../../gcc-3.4.0/gcc/gthr.h:96, from ../../gcc-3.4.0/gcc/unwind-dw2.c:42: ../../gcc-3.4.0/gcc/gthr-posix.h:46: error: parse error before "__gthread_key_t" ../../gcc-3.4.0/gcc/gthr-posix.h:46: warning: type defaults to `int' in declaration of `__gthread_key_t' ../../gcc-3.4.0/gcc/gthr-posix.h:46: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h:47: error: parse error before "__gthread_once_t" ../../gcc-3.4.0/gcc/gthr-posix.h:47: warning: type defaults to `int' in declaration of `__gthread_once_t' ../../gcc-3.4.0/gcc/gthr-posix.h:47: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h:48: error: parse error before "__gthread_mutex_t" ../../gcc-3.4.0/gcc/gthr-posix.h:48: warning: type defaults to `int' in declaration of `__gthread_mutex_t' ../../gcc-3.4.0/gcc/gthr-posix.h:48: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_active_p': ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: `pthread_create' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: (Each undeclared identifier is reported only once ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: for each function it appears in.) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:456: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:456: error: parse error before ')' token ../../gcc-3.4.0/gcc/gthr-posix.h:465: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:465: error: parse error before ')' token ../../gcc-3.4.0/gcc/gthr-posix.h:471: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:472: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_key_delete': ../../gcc-3.4.0/gcc/gthr-posix.h:472: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:473: warning: implicit declaration of function `pthread_key_delete' ../../gcc-3.4.0/gcc/gthr-posix.h:473: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:477: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:478: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_getspecific': ../../gcc-3.4.0/gcc/gthr-posix.h:478: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:479: warning: implicit declaration of function `pthread_getspecific' ../../gcc-3.4.0/gcc/gthr-posix.h:479: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:479: warning: return makes pointer from integer without a cast ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:483: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:484: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_setspecific': ../../gcc-3.4.0/gcc/gthr-posix.h:484: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:485: warning: implicit declaration of function `pthread_setspecific' ../../gcc-3.4.0/gcc/gthr-posix.h:485: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:485: error: `ptr' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:489: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:490: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_lock': ../../gcc-3.4.0/gcc/gthr-posix.h:490: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:492: warning: implicit declaration of function `pthread_mutex_lock' ../../gcc-3.4.0/gcc/gthr-posix.h:492: error: `mutex' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:498: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:499: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_trylock': ../../gcc-3.4.0/gcc/gthr-posix.h:499: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:501: warning: implicit declaration of function `pthread_mutex_trylock' ../../gcc-3.4.0/gcc/gthr-posix.h:501: error: `mutex' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:507: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:508: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_unlock': ../../gcc-3.4.0/gcc/gthr-posix.h:508: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:510: warning: implicit declaration of function `pthread_mutex_unlock' ../../gcc-3.4.0/gcc/gthr-posix.h:510: error: `mutex' undeclared (first use in this function) make[2]: *** [libgcc/./unwind-dw2.o] Error 1 make[2]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make[1]: *** [libgcc.a] Error 2 make[1]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make: *** [all-gcc] Error 2 From helm@fs.tum.de Mon Aug 16 23:54:00 2004 From: helm@fs.tum.de (Alexander Helm) Date: Mon, 16 Aug 2004 23:54:00 -0000 Subject: Optimized code with GCC-3.3.3 In-Reply-To: <1092670127.4120d2af702b0@webmail.welho.com> References: <1092670127.4120d2af702b0@webmail.welho.com> Message-ID: <412101AC.2080800@fs.tum.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, march includes mcpu. Or mathematically march => mcpu (this is what implies means). CU Alexander petsku86@welho.com wrote: | Hi! | I am trying to optimize to code produced by gcc-3.3.3 for my pentium4. | After reading the following manual page a got a little confused. | | http://tinyurl.com/5zt9b | | Does -march=cpu-type mean that a I automaticly have also -mcpu or do I have | to specify them both to get the best possible code? Imply is a verb which | when translated to my language (Finnish) could mean that it comes automaticly | or it needs to be specified. I tried using google but I didn't get any | answers there because I saw the -march option used both with and without | -mcpu. Thanks in advance. | | Regards, | Petteri R??ty -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBIQGsgRDwdtJH/NcRAlQ1AJ0eithYpzo656EKoS5aRDh6pPm//QCggQT5 rJL1E7lWsL2ufPowC2rLoxk= =MoHR -----END PGP SIGNATURE----- From jd2419@sbc.com Tue Aug 17 11:30:00 2004 From: jd2419@sbc.com (DY, JERRY U (SBCSI)) Date: Tue, 17 Aug 2004 11:30:00 -0000 Subject: Help with specs Message-ID: Here's my config: g++ -v Reading specs from /usr/local/appl/gcc-3.4.1/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.1/specs Configured with: ../gcc-3.4.1/configure --prefix=/usr/local/appl/gcc --with-as=/usr/local/appl/binutils/bin/as --enable-threa ds=posix Thread model: posix gcc version 3.4.1 I wanted to change the specs so that -D_INCLUDE__STDC_A1_SOURCE is defined everytime the precompiler is invoked, so I modify the cpp entry in the specs file as follows: *cpp: -D_INCLUDE__STDC_A1_SOURCE %{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L} But it doesn't appear to be working. Is there something wrong with my syntax or am I missing something? Thanks! -Jerry From trick@icculus.org Tue Aug 17 13:54:00 2004 From: trick@icculus.org (Gerry) Date: Tue, 17 Aug 2004 13:54:00 -0000 Subject: Creating executable shared libraries ? In-Reply-To: References: <200408132145.56429.trick@icculus.org> Message-ID: <200408170154.50007.trick@icculus.org> mandag 16 august 2004, 17:42, skrev Segher Boessenkool: > See http://gcc.gnu.org/ml/gcc-help/2003-07/msg00232.html . Thanks, but I'm still having problems. The shared library can now be run and call functions without a problem, but argc and argv are garbage. This is a problem, because the main function needs to know its invocation name, and it also takes arguments. I suppose I can use readlink with /proc/self/exe to get the executable name at least, and possibly /proc/self/cmdline for the arguments (gotta try that), but is there another (better) way ? (Also, returning from main segfaults, is that normal ? Not that *that*'s a problem, setting return type to void and just using exit works fine). Also, I had to change "/lib/ld.so.1" to "/lib/ld-linux.so.2" since the first one doesn't exist on my box ("ld-linux.so.2" is a symlink to "ld-2.3.2.so"). Is there a way to have this work with both (or any ld.so's) without a recompile ? The lib is open source, so compile-time config isn't a problem, but it'd be nice if pre-compiled binaries could support both. (Tried using multiple .interp strings, but that didn't seem to work.) Here's a test program, compiled with (seem to remember that -DPIC from somewhere, don't know if it's necessary ?) gcc -W -Wall -fPIC -DPIC -shared test.c -o test -Wl,-e,my_main -- 8< -- #include #include const char interp[] __attribute__((section(".interp"))) = "/lib/ld-linux.so.2"; void my_main (int argc, char *argv[]) { printf("argc = %i (%u)\nargv = %p\n", argc, argc, argv); printf("*argv = %s\n", *argv); exit(0); } -- 8< -- Output (the numbers at argc/argv are constant for same arguments, but change for different args -- the difference in values seems to hint that the args are stored, but the address isn't readable): -- 8< -- $ ./test argc = -1073744275 (3221223021) argv = (nil) Segmentation fault $ ./test 1 argc = -1073744277 (3221223019) argv = 0xbffff672 Segmentation fault $ ./test 1 2 argc = -1073744279 (3221223017) argv = 0xbffff670 Segmentation fault $ ./test 1 23 argc = -1073744280 (3221223016) argv = 0xbffff66f Segmentation fault -- 8< -- Any ideas ? (Thought about using mprotect, but that seems a bit, eh, hackish and insecure..) - Gerry From segher@kernel.crashing.org Tue Aug 17 15:34:00 2004 From: segher@kernel.crashing.org (Segher Boessenkool) Date: Tue, 17 Aug 2004 15:34:00 -0000 Subject: Creating executable shared libraries ? In-Reply-To: <200408170154.50007.trick@icculus.org> References: <200408132145.56429.trick@icculus.org> <200408170154.50007.trick@icculus.org> Message-ID: >> See http://gcc.gnu.org/ml/gcc-help/2003-07/msg00232.html . > > Thanks, but I'm still having problems. The shared library can now be > run and > call functions without a problem, but argc and argv are garbage. I never had that problem -- are you sure it really gets it wrong, and it is not just gdb not showing you the right stuff? Or maybe your arch needs a bit more init or something. > (Also, returning from main segfaults, is that normal ? No. > Also, I had to change "/lib/ld.so.1" to "/lib/ld-linux.so.2" since the > first > one doesn't exist on my box ("ld-linux.so.2" is a symlink to > "ld-2.3.2.so"). Yeah, this example code was on an older ppc32-linux system. > Is there a way to have this work with both (or any ld.so's) without a > recompile ? The lib is open source, so compile-time config isn't a > problem, > but it'd be nice if pre-compiled binaries could support both. (Tried > using > multiple .interp strings, but that didn't seem to work.) You need the exact same version of ld.so and libc.so anyway, so just have the right one found at compile time -- don't know how to do that the easy way, sorry. Segher From jmah@caduc.com Tue Aug 17 16:22:00 2004 From: jmah@caduc.com (Joseph Mah) Date: Tue, 17 Aug 2004 16:22:00 -0000 Subject: Dependency line needs colon or double colon? Message-ID: <023101c48461$6ac0f060$515aa8c0@WNYCCAD105283JM> Hello, I am trying to compile gcc and am using gnu Make 3.8.0: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap in AIX 4.3.3 I am getting a series of errors as follows. I've checked through the Makefile itself but I don't understand what is wrong. Is there a certain format or set of spaces, tabs required? ---------------------------------- Target "all" is up to date. Target "all" is up to date. : make ; exec true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" " CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=-O2 -g -O2" "INSTALL= /opt/gcc-3.4.1/install-sh -c" "INSTALL_DATA=/opt/gcc-3.4.1/install-sh -c -m 644 " "INSTALL_PROGRAM=/opt/gcc-3.4.1/install-sh -c" "INSTALL_SCRIPT=/opt/gcc-3.4. 1/install-sh -c" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-O2 -g - O2" "MAKE=make" "MAKEINFO=/opt/gcc-3.4.1/missing makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTES T=runtest" "RUNTESTFLAGS=" "exec_prefix=/usr/local" "infodir=/usr/local/info" "libdir=/usr/local/lib" "prefix=/usr/local" "tooldir=/usr/local/powerpc-ibm- aix4.3.3.0" "AR=ar" "AS=as" "CC=gcc" "CXX=c++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do Target "all" is up to date. Bootstrapping the compiler "Makefile", line 732: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 733: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 734: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 735: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 736: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 737: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 738: make: 1254-055 Dependency line needs colon or double c olon operator. "Makefile", line 739: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 740: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 741: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 742: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 743: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 744: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 745: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 746: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 747: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 748: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 749: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 933: make: 1254-055 Dependency line needs colon or double colon operator. "/opt/gcc-3.4.1/gcc/cp/Make-lang.in", line 127: make: 1254-055 Dependency line n eeds colon or double colon operator. "Makefile", line 935: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 941: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 943: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 946: make: 1254-055 Dependency line needs colon or double colon operator. "", line 0: make: 1254-027 Cannot open . "Makefile", line 948: make: 1254-055 Dependency line needs colon or double colon operator. make: 1254-058 Fatal errors encountered -- cannot continue. make: 1254-004 The error code from the last command is 2. From iainw@nortelnetworks.com Tue Aug 17 17:19:00 2004 From: iainw@nortelnetworks.com (Iain Woolf) Date: Tue, 17 Aug 2004 17:19:00 -0000 Subject: Which version of bison needed to build gcc2.95(ish) Message-ID: <41222598.9090505@americasm01.nt.com> Hi, I'm trying to build gcc2.96 on a linux box (redhat with kernel 2.4.18-27.7.x) from the source provided by WindRiver and have run into a problem with the bison stage of the build. Initially it was giving me errors missing semi-colons. I saw from various mailing list archives that this was a common error when building gcc pre-v3.0 using bison post-v1.34, so I installed bison v1.33. Now bison will process the file, but finds a different number of shift/reduce conflicts than expected: ... cd ../../gcc/objc; \ bison -o objc-parse.c objc-parse.y objc-parse.y contains 72 shift/reduce conflicts. expected 66 shift/reduce conflicts make[1]: *** [../../gcc/objc/objc-parse.c] Error 1 Does anyone know what version of bison will give the right number? Alternatively is there any other way to get past this? (I've tried commenting out the "%expect 66" line, but run into another error later on which I suspect is related to me bypassing this parsing issue) Any help appreciated. Cheers, Iain From lrtaylor@micron.com Tue Aug 17 21:34:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Tue, 17 Aug 2004 21:34:00 -0000 Subject: Dependency line needs colon or double colon? Message-ID: <363801FFD7B74240A329CEC3F7FE4CC4030960CC@ntxboimbx07.micron.com> Are you using GNU make or AIX's make? You need to be using GNU make. Run 'make -v' to find out. If it's GNU, you'll know based on the output. If it gives you an error, then it's not GNU make. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Joseph Mah Sent: Tuesday, August 17, 2004 7:52 AM To: gcc-help@gcc.gnu.org Subject: Dependency line needs colon or double colon? Hello, I am trying to compile gcc and am using gnu Make 3.8.0: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap in AIX 4.3.3 I am getting a series of errors as follows. I've checked through the Makefile itself but I don't understand what is wrong. Is there a certain format or set of spaces, tabs required? ---------------------------------- Target "all" is up to date. Target "all" is up to date. : make ; exec true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" " CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=-O2 -g -O2" "INSTALL= /opt/gcc-3.4.1/install-sh -c" "INSTALL_DATA=/opt/gcc-3.4.1/install-sh -c -m 644 " "INSTALL_PROGRAM=/opt/gcc-3.4.1/install-sh -c" "INSTALL_SCRIPT=/opt/gcc-3.4. 1/install-sh -c" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-O2 -g - O2" "MAKE=make" "MAKEINFO=/opt/gcc-3.4.1/missing makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTES T=runtest" "RUNTESTFLAGS=" "exec_prefix=/usr/local" "infodir=/usr/local/info" "libdir=/usr/local/lib" "prefix=/usr/local" "tooldir=/usr/local/powerpc-ibm- aix4.3.3.0" "AR=ar" "AS=as" "CC=gcc" "CXX=c++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do Target "all" is up to date. Bootstrapping the compiler "Makefile", line 732: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 733: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 734: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 735: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 736: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 737: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 738: make: 1254-055 Dependency line needs colon or double c olon operator. "Makefile", line 739: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 740: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 741: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 742: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 743: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 744: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 745: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 746: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 747: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 748: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 749: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 933: make: 1254-055 Dependency line needs colon or double colon operator. "/opt/gcc-3.4.1/gcc/cp/Make-lang.in", line 127: make: 1254-055 Dependency line n eeds colon or double colon operator. "Makefile", line 935: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 941: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 943: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 946: make: 1254-055 Dependency line needs colon or double colon operator. "", line 0: make: 1254-027 Cannot open . "Makefile", line 948: make: 1254-055 Dependency line needs colon or double colon operator. make: 1254-058 Fatal errors encountered -- cannot continue. make: 1254-004 The error code from the last command is 2. From krisma-jean_jablonski@expresso.com.br Wed Aug 18 06:42:00 2004 From: krisma-jean_jablonski@expresso.com.br (Krisma-jean_jablonski) Date: Wed, 18 Aug 2004 06:42:00 -0000 Subject: Compiler Message-ID: Hi, my Name is Jean and I need help to compiler a source to an executable (rbatfile.exe) for DEC Alpha 21064 APX on windows NT 4.0 SP6. ________________________________________________ This mail was sent by Webmail Expresso 2.5 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: rbatfile.c URL: From dr_moreira@yahoo.com.br Wed Aug 18 07:18:00 2004 From: dr_moreira@yahoo.com.br (=?iso-8859-1?q?daniel=20rangel?=) Date: Wed, 18 Aug 2004 07:18:00 -0000 Subject: Dummy problem when linking Message-ID: <20040817213435.36420.qmail@web14627.mail.yahoo.com> Hi, i have two objs (that i would like to make a lib): rddpgsql.c rddpgsql0.c and im trying to link this files against a source file (tstconn.c) that will use symbos that belongs to the two file above with the following command: gcc -otstconn -I/usr/include/xharbour -L/usr/lib/xharbour -lpq -lxharbour -lslang rddpgsql.o rddpgsql0.o tstconn.c and it tells me that there is unresolved symbols on tstconn.c that are the symbols presente in the rddpgsql.o(i saw them with nm) and the weird is that if i put the statement '-lpq' after tstconn.c i get unresolved symbols from libpq like ssl and krb5 functions called by that lib. could anyone give me a clue on what is happening? best regards, []??s daniel rangel moreira _______________________________________________________ Yahoo! Acesso Gr??tis - navegue de gra??a com conex??o de qualidade! Acesse: http://br.acesso.yahoo.com/ From suresh@comodogroup.com Wed Aug 18 08:56:00 2004 From: suresh@comodogroup.com (L.Suresh) Date: Wed, 18 Aug 2004 08:56:00 -0000 Subject: Problem with std::ostringstream operator<<(long) Message-ID: <1092811333.5322.36.camel@Ironwing> Hi, I'm getting a segmentation fault in my program when using std::ostringstream. Code excertps: std::ostringstream ostr; ostr << pInfo.getPacketId(); // <-- Offending line. calls op<<(long) ... Output few more strings ..... std::cout << ostr.str() << std::endl GDB: Stack trace #0 0x0075cdb2 in _int_malloc () from /lib/tls/libc.so.6 #1 0x0075c10d in malloc () from /lib/tls/libc.so.6 #2 0x00b7c80e in operator new(unsigned) () from /usr/lib/libstdc++.so.5 #3 0x00b68c49 in std::__default_alloc_template::allocate(unsigned) () from /usr/lib/libstdc++.so.5 #4 0x00b6e678 in std::string::_Rep::_S_create(unsigned, std::allocator const&) () from /usr/lib/libstdc++.so.5 #5 0x00b6e749 in std::string::_Rep::_M_clone(std::allocator const&, unsigned) () from /usr/lib/libstdc++.so.5 #6 0x00b6c3bd in std::string::reserve(unsigned) () from /usr/lib/libstdc++.so.5 #7 0x00b6347f in std::basic_stringbuf, std::allocator >::overflow(int) () from /usr/lib/libstdc++.so.5 #8 0x00b69ee4 in std::basic_streambuf >::xsputn(char const*, int) () from /usr/lib/libstdc++.so.5 #9 0x00b499ff in std::ostreambuf_iterator > std::num_put > >::_M_convert_int(std::ostreambuf_iterator >, std::ios_base&, char, long) const () from /usr/lib/libstdc++.so.5 #10 0x00b495e0 in std::num_put > >::do_put(std::ostreambuf_iterator >, std::ios_base&, char, long) const () from /usr/lib/libstdc++.so.5 #11 0x00b5ef9c in std::ostream::operator<<(long) () #12 0x0806a99b in Engine::NullEngine::analyze(NA::PacketInfo const&) ( this=0x8f9c860, pInfo=@0x8fe3058) at packetinfo.h:146 #13 0x080721c6 in App::WorkerThreadTask::run(Thread*) (this=0x9062860, th=0x9072fc0) at ../application/workerthreadtask.cpp:39 #14 0x0804fe50 in Thread::start(void*) (data=0x9072fc0) at ../util/thread.cpp:122 #15 0x0097b79c in start_thread () from /lib/tls/libpthread.so.0 #16 0x007c827a in clone () from /lib/tls/libc.so.6 From michal017@centrum.sk Wed Aug 18 09:05:00 2004 From: michal017@centrum.sk (m.) Date: Wed, 18 Aug 2004 09:05:00 -0000 Subject: Problem with std::ostringstream operator<<(long) In-Reply-To: <1092811333.5322.36.camel@Ironwing> References: <1092811333.5322.36.camel@Ironwing> Message-ID: <412302BF.8090506@centrum.sk> I had similar problems when compiling threaded applications with gcc that was compiled with thread model single. m. L.Suresh wrote: > Hi, > I'm getting a segmentation fault in my program when using > std::ostringstream. > > Code excertps: > > std::ostringstream ostr; > ostr << pInfo.getPacketId(); // <-- Offending line. calls op<<(long) > > ... Output few more strings ..... > > std::cout << ostr.str() << std::endl > > > GDB: Stack trace > > #0 0x0075cdb2 in _int_malloc () from /lib/tls/libc.so.6 > #1 0x0075c10d in malloc () from /lib/tls/libc.so.6 > #2 0x00b7c80e in operator new(unsigned) () from /usr/lib/libstdc++.so.5 > #3 0x00b68c49 in std::__default_alloc_template 0>::allocate(unsigned) () > from /usr/lib/libstdc++.so.5 > #4 0x00b6e678 in std::string::_Rep::_S_create(unsigned, > std::allocator const&) () from /usr/lib/libstdc++.so.5 > #5 0x00b6e749 in std::string::_Rep::_M_clone(std::allocator > const&, unsigned) () from /usr/lib/libstdc++.so.5 > #6 0x00b6c3bd in std::string::reserve(unsigned) () > from /usr/lib/libstdc++.so.5 > #7 0x00b6347f in std::basic_stringbuf, > std::allocator >::overflow(int) () from /usr/lib/libstdc++.so.5 > #8 0x00b69ee4 in std::basic_streambuf > >>::xsputn(char const*, int) () from /usr/lib/libstdc++.so.5 > > #9 0x00b499ff in std::ostreambuf_iterator > >>std::num_put > std::char_traits > > >>::_M_convert_int(std::ostreambuf_iterator > std::char_traits >, std::ios_base&, char, long) const () from > /usr/lib/libstdc++.so.5 > #10 0x00b495e0 in std::num_put std::char_traits > >::do_put(std::ostreambuf_iterator std::char_traits >, std::ios_base&, char, long) const () from > /usr/lib/libstdc++.so.5 > #11 0x00b5ef9c in std::ostream::operator<<(long) () > #12 0x0806a99b in Engine::NullEngine::analyze(NA::PacketInfo const&) ( > this=0x8f9c860, pInfo=@0x8fe3058) at packetinfo.h:146 > #13 0x080721c6 in App::WorkerThreadTask::run(Thread*) (this=0x9062860, > th=0x9072fc0) at ../application/workerthreadtask.cpp:39 > #14 0x0804fe50 in Thread::start(void*) (data=0x9072fc0) > at ../util/thread.cpp:122 > #15 0x0097b79c in start_thread () from /lib/tls/libpthread.so.0 > #16 0x007c827a in clone () from /lib/tls/libc.so.6 > > > > From ashok.anand@gmail.com Wed Aug 18 11:25:00 2004 From: ashok.anand@gmail.com (Ashok Anand) Date: Wed, 18 Aug 2004 11:25:00 -0000 Subject: INT_TYPE_SIZE 32 to 16 Message-ID: <854da8df0408180156ecfa777@mail.gmail.com> hi, I am facing a problem while building gcc. I only changed value of INT_TYPE_SIZE defined in file gcc-3.4.1\gcc\config\i386\i386.h to 16, specifying that int size is 16 bits instead of 32 bits, When i ran make , it didn't build and gave errors. This was the only change i made. Please tell me how i can specify int size to be 16 bits rather than 32 bits. regex.c: At top level: regex.c:8178: warning: unused parameter 'preg' regex.c: In function `byte_re_match_2_internal': regex.c:7576: error: unrecognizable insn: (insn:HI 2861 6401 2862 228 regex.c:7833 (parallel [ (set (reg:SI 1211 [ mcnt ]) (zero_extend:DI (subreg:HI (reg/v:SI 71 [ mcnt ]) 0))) (clobber (reg:CC 17 flags)) ]) -1 (nil) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))) regex.c:7576: internal compiler error: in extract_insn, at recog.c:2083 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make[1]: *** [regex.o] Error 1 make[1]: Leaving directory `/cygdrive/e/gcc/gcc-3.4.1/i686-pc-cygwin/libiberty' make: *** [all-target-libiberty] Error 2 With regards, -ashok From ankitjain1580@yahoo.com Wed Aug 18 13:59:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Wed, 18 Aug 2004 13:59:00 -0000 Subject: INT_TYPE_SIZE 32 to 16 In-Reply-To: <854da8df0408180156ecfa777@mail.gmail.com> Message-ID: <20040818090535.50077.qmail@web52901.mail.yahoo.com> hi well i dont understand why u need to decrease the size of int in linux. what u could have simply done is use int16_t or uint16_t for unsigned integer. it will work fine all u have to do is add inttypes.h header file bye ankit --- Ashok Anand wrote: > hi, > > I am facing a problem while building gcc. I > only changed value of > INT_TYPE_SIZE defined in file > gcc-3.4.1\gcc\config\i386\i386.h > to 16, specifying that int size is 16 bits > instead of 32 bits, > When i ran make , it didn't build and gave errors. > This was the only > change i made. Please tell me how i can specify > int size to be 16 > bits rather than 32 bits. > > regex.c: At top level: > regex.c:8178: warning: unused parameter 'preg' > regex.c: In function `byte_re_match_2_internal': > regex.c:7576: error: unrecognizable insn: > (insn:HI 2861 6401 2862 228 regex.c:7833 (parallel [ > (set (reg:SI 1211 [ mcnt ]) > (zero_extend:DI (subreg:HI (reg/v:SI > 71 [ mcnt ]) 0))) > (clobber (reg:CC 17 flags)) > ]) -1 (nil) > (expr_list:REG_UNUSED (reg:CC 17 flags) > (nil))) > regex.c:7576: internal compiler error: in > extract_insn, at recog.c:2083 > Please submit a full bug report, > with preprocessed source if appropriate. > See for > instructions. > make[1]: *** [regex.o] Error 1 > make[1]: Leaving directory > `/cygdrive/e/gcc/gcc-3.4.1/i686-pc-cygwin/libiberty' > make: *** [all-target-libiberty] Error 2 > > With regards, > -ashok > ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From eljay@adobe.com Wed Aug 18 14:12:00 2004 From: eljay@adobe.com (John Love-Jensen) Date: Wed, 18 Aug 2004 14:12:00 -0000 Subject: Dummy problem when linking In-Reply-To: <20040817213435.36420.qmail@web14627.mail.yahoo.com> Message-ID: Hi Daniel, I believe the order in the command line is important. The symbols are "unresolved" because when the linker sees the symbol, nothing requires it so it doesn't include it, then LATER a file needs the symbol... but it's not a two-pass link, and the symbol isn't seen again. Thus, unresolved. Order is important. Put the unresolved items BEFORE, and the thing that supplies the unresolved items AFTER. HTH, --Eljay From fulldecent@gmail.com Wed Aug 18 15:00:00 2004 From: fulldecent@gmail.com (Full Decent) Date: Wed, 18 Aug 2004 15:00:00 -0000 Subject: Feature request: incremental compiling Message-ID: I request gcc to have the feature of incremental compiling: Gcc should have an option to compile source by reading line-for-line rather than buffering the whole file. This would allow you to essentially cat | gcc - and watch errors/warnings come up as you type in code. The advantage of this feature would be amazing for IDE's, they could offer realtime hilighting of error/warning lines in code. From eljay@adobe.com Thu Aug 19 07:34:00 2004 From: eljay@adobe.com (John Love-Jensen) Date: Thu, 19 Aug 2004 07:34:00 -0000 Subject: Feature request: incremental compiling In-Reply-To: Message-ID: Hi Full Decent, Eclipse 3.0 IDE with CDT 2.0 offers nearly real-time highlighting of error/warning lines in C/C++ code. CDT stands for "C/C++ Development Tools", a plug-in for the Eclipse IDE platform. Eclipse is the best IDE I've used. And usually, I eschew IDE's in favor of Vim. (Now only if the Vim editor was a free-and-well-integrated plug-in for Eclipse. But alas.) Sincerely, --Eljay From Rongjun.Lu@cern.ch Thu Aug 19 11:19:00 2004 From: Rongjun.Lu@cern.ch (Rongjun Lu) Date: Thu, 19 Aug 2004 11:19:00 -0000 Subject: error in building gcc 2.95.3 Message-ID: <3FC7FEE5A901664193468E8F63AFE1EA4D30F0@cernxchg15.cern.ch> Dear Sir: After failing to compile gcc3.4.0,I chang to gcc2.95.3 with binutils 2.10.1. Building binutils is successful, and the gcc is almost successful.The error is as following, but I don't know where is "asm/unistd.h"is from. How to resovle it? Thanks. configure gcc as: ../gcc-2.95.3/config --target=arm-linux --prefix=/home/lurj/board_tms5471/tools --without-headers --with-newlib --enable-languages=c error: --------------------------------------------- ............ rm -f tmplibgcc1.a libgcc1.S cp ../../gcc-2.95.3/gcc/config/arm/lib1funcs.asm libgcc1.S for name in _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx; \ do \ echo ${name}; \ /home/lurj/board_tms5471/build-tools/build-gcc/gcc/xgcc -B/home/lurj/board_tms5471/build-tools/build-gcc/gcc/ -B/home/lurj/board_tms5471/tools/arm-linux/bin/ -I/home/lurj/board_tms5471/tools/arm-linux/include -O2 -DCROSS_COMPILE -DIN_GCC -g -O2 -I./include -fomit-frame-pointer -fPIC -Dinhibit_libc -D__gthr_posix_h -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I../../gcc-2.95.3/gcc -I../../gcc-2.95.3/gcc/config -I../../gcc-2.95.3/gcc/../include -c -DL${name} libgcc1.S; \ if [ $? -eq 0 ] ; then true; else exit 1; fi; \ mv libgcc1.o ${name}.o; \ arm-linux-ar rc tmplibgcc1.a ${name}.o; \ rm -f ${name}.o; \ done _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx libgcc1.S:438: asm/unistd.h: No such file or directory make[1]: *** [libgcc1-asm.a] Error 1 make[1]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make: *** [all-gcc] Error 2 ---------------------------------------------- From ankitjain1580@yahoo.com Thu Aug 19 15:27:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Thu, 19 Aug 2004 15:27:00 -0000 Subject: assembler error Message-ID: <20040819073419.5358.qmail@web52903.mail.yahoo.com> 1 #include 2 int main() 3 { 4 uint8_t a[32]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27, 28,29,30,31,32},i=0,b[32],j=0; 5 for(i=0;i<32;i=i+8) 6 { 7 asm("movq (%1), %%mm0 \n\t" 8 "movq %%mm0, (%0) \n\t" 9 :"=r"(b[i]) 10 :"r"(a[i]) 11 :"%mm0" 12 ); 13 while(j<32) 14 {printf("%d ",b[j]);j++;} 15 } 16 return 0; 17 } this gives a assembler error? /tmp/ccO1Jllb.s: Assembler messages: /tmp/ccO1Jllb.s:68: Error: `(%al)' is not a valid 32 bit base/index expression /tmp/ccO1Jllb.s:69: Error: `(%al)' is not a valid 32 bit base/index expression WHY? ankit jain ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From eljay@adobe.com Thu Aug 19 15:55:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 19 Aug 2004 15:55:00 -0000 Subject: assembler error References: <20040819073419.5358.qmail@web52903.mail.yahoo.com> Message-ID: <00ca01c485de$68459100$a8b2f882@PS253> Hi Ankit, Your a[32] array and b[32] array are not stored in registers, they are stored in memory. But you are using a "r" specifier instead of a "m" specifier. I changed your example to use "m", and set b to all 255, and also changed the printf loop to print each time instead of just the first time, and then the assembly snippet copied a to b in four iterations. HTH, --Eljay From balan@myway.com Thu Aug 19 16:21:00 2004 From: balan@myway.com (balan) Date: Thu, 19 Aug 2004 16:21:00 -0000 Subject: question Message-ID: <20040819152750.0BBE53998@mprdmxin.myway.com> Hi This is balan frm chennai, i getting more help from the site http://gcc.gnu.org pertaining to Gnu C++ Compiler and thanx Answer to my question pls What is abrevation of GNU ? with regards balan _______________________________________________ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com From eljay@adobe.com Thu Aug 19 16:27:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 19 Aug 2004 16:27:00 -0000 Subject: question In-Reply-To: <20040819152750.0BBE53998@mprdmxin.myway.com> References: <20040819152750.0BBE53998@mprdmxin.myway.com> Message-ID: <6.1.2.0.2.20040819105452.01ecde78@iplan-mn.corp.adobe.com> Hi Balan, GNU - GNU's Not Unix --Eljay From jiayu@huawei.com Thu Aug 19 18:30:00 2004 From: jiayu@huawei.com (jiayu 33576) Date: Thu, 19 Aug 2004 18:30:00 -0000 Subject: Help! A C++ compiling error! Message-ID: We are using gcc 2.96 which is supplied by windriver with Tornado 2.2. The information is : C:/Tornado/host/x86-win32/include/g++-3/stl_iterator.h: In function `void distance (_InputIterator, _InputIterator, _Distance &) [with _InputIterator = _Rb_tree_iterator, pair &, pair *>, _Distance = size_t]': C:/Tornado/host/x86-win32/include/g++-3/stl_iterator.h:278: instantiated from `_Rb_tree_base, allocator >' C:/Tornado/host/x86-win32/include/g++-3/stl_map.h:76: instantiated from `_Rb_tree, _Select1st >, less, allocator >' C:/Tornado/host/x86-win32/include/g++-3/stl_map.h:76: instantiated from `map, allocator >' ../../../src/momu/src/mml/mml_cmdpara.h:247: instantiated from here C:/Tornado/host/x86-win32/include/g++-3/stl_iterator.h:278: Internal compiler error in `expand_call', at calls.c:3146 make: *** [obj/mml_cmdpara.obj] Error 0x1 mml_cmdpara.h: typedef map > T_MML_PARA_POS; ...... class T_MML_CMDPARA { ...... Line 247: T_MML_PARA_POS m_ParaPos; } The code can be compiled correctly in gcc 2.76 which is supplied by Tornado 2.0. I am confused. Please help me! Thanks a lot! name: jiayu email: jiayu@huawei.com ************************************************************** This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! ************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: j33576.vcf Type: text/x-vcard Size: 84 bytes Desc: Card for jiayu 33576 URL: From ian@wasabisystems.com Thu Aug 19 18:40:00 2004 From: ian@wasabisystems.com (Ian Lance Taylor) Date: Thu, 19 Aug 2004 18:40:00 -0000 Subject: Help! A C++ compiling error! In-Reply-To: References: Message-ID: jiayu 33576 writes: > We are using gcc 2.96 which is supplied by windriver with Tornado 2.2. That is a very old version--the current version is 3.4.1. Moreover there was no official gcc release with the version number 2.96--there was 2.95, but no 2.96, so we can not know what your actual compiler sources look like. I recommend that you contact Wind River for help with this. Ian From Vinita_Sinha@tesseract.com Thu Aug 19 18:44:00 2004 From: Vinita_Sinha@tesseract.com (Sinha, Vinita) Date: Thu, 19 Aug 2004 18:44:00 -0000 Subject: compile and link a C with embedded SQl program using gcc and DB2 Message-ID: <92F42ACDF6EDA547BA003A49A68A651E0B2D3E@tessmail.tesseract.com> Hi, I am trying to compile a simple sql program using c and DB2 . It fails in the link step.Which are the other Libraries I need to add in the link step to make it work ? This is the bat file for compile @echo off rem Licensed Materials - Property of IBM if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -I"C:\Program Files\SQLLIB\samples\cli" -O0 -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -L"C:\Program Files\SQLLIB\include" -L"C:\Program Files\SQLLIB\lib\db2api.lib" -L"C:\Program Files\SQLLIB\samples\c" -L"C:\Program Files\SQLLIB\bin" -o2006b.exe sqlexample.o goto exit The compile log with errors : C:\R20006\cPrograms>bldappgcc.bat sqlexample Replica1 db2admin db2admin Database Connection Information Database server = DB2/NT 8.1.0 SQL authorization ID = DB2ADMIN Local database alias = REPLICA1 LINE MESSAGES FOR sqlexample.sqc ------ -------------------------------------------------------------------- SQL0060W The "C" precompiler is in progress. SQL0091W Precompilation or binding was ended with "0" errors and "0" warnings. LINE MESSAGES FOR sqlexample.bnd ------ -------------------------------------------------------------------- SQL0061W The binder is in progress. SQL0091N Binding was ended with "0" errors and "0" warnings. DB20000I The SQL command completed successfully. C:\R20006\cPrograms>rem Compile the program. C:\R20006\cPrograms>if exist "sqlexample.cxx" goto cpp_emb C:\R20006\cPrograms>goto link_embedded C:\R20006\cPrograms>gcc -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\ SQLLIB\samples\c" -I"C:\Program Files\SQLLIB\samples\cli" -O0 -g3 -Wall -c -fmes sage-length=0 -osqlexample.o sqlexample.c sqlexample.sqc:73:18: warning: character constant too long for its type sqlexample.sqc:73:30: warning: character constant too long for its type sqlexample.sqc:73:42: warning: character constant too long for its type sqlexample.sqc: In function `main': sqlexample.sqc:73: warning: passing arg 1 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:73: warning: passing arg 2 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:73: warning: passing arg 3 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:87: warning: control reaches end of non-void function sqlexample.sqc: In function `TbBasicSelect': sqlexample.sqc:121: warning: unused variable `rc' C:\R20006\cPrograms>gcc -L"C:\Program Files\SQLLIB\include" -L"C:\Program Files\ SQLLIB\lib\db2api.lib" -L"C:\Program Files\SQLLIB\samples\c" -L"C:\Program File s\SQLLIB\bin" -o2006b.exe sqlexample.o sqlexample.o(.text+0xce): In function `main': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefined reference to `_sqlastr t@12' sqlexample.o(.text+0xfd):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefin ed reference to `_sqlacall@20' sqlexample.o(.text+0x10c):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefi ned reference to `_sqlastop@4' sqlexample.o(.text+0x24a): In function `DbConnect': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undefined reference to `_sqlast rt@12' sqlexample.o(.text+0x271):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x31c):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x34b):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x35a):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlastop@4' sqlexample.o(.text+0x380):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlastrt@12' sqlexample.o(.text+0x3a7):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x406):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x435):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x444):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlastop@4' sqlexample.o(.text+0x4b1): In function `TbBasicSelect': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undefined reference to `_sqlast rt@12' sqlexample.o(.text+0x4d8):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x538):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x567):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x576):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlastop@4' collect2: ld returned 1 exit status C:\R20006\cPrograms>rem link -debug -out:sqlexample.exe sqlexample.obj utilemb.o bj db2api.lib C:\R20006\cPrograms>goto exit The system cannot find the batch label specified - exit C:\R20006\cPrograms> Any help will be appreciated Thanks Vinita From eljay@adobe.com Fri Aug 20 06:49:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 20 Aug 2004 06:49:00 -0000 Subject: compile and link a C with embedded SQl program using gcc and DB2 In-Reply-To: <92F42ACDF6EDA547BA003A49A68A651E0B2D3E@tessmail.tesseract.com> References: <92F42ACDF6EDA547BA003A49A68A651E0B2D3E@tessmail.tesseract.com> Message-ID: <6.1.2.0.2.20040819133818.01e92790@iplan-mn.corp.adobe.com> Hi Vinita, The errors are DB2 errors, not GCC errors. Unless there happens to be somebody on this forum with DB2 experience in the particular environment you are working in (doubtful, but could happen), you'll probably have better luck inquiring on a DB2 help forum. Sincerely, --Eljay From gbras@anacomp.com Fri Aug 20 08:03:00 2004 From: gbras@anacomp.com (Bras, Gerard) Date: Fri, 20 Aug 2004 08:03:00 -0000 Subject: compile and link a C with embedded SQl program using gcc and DB2 Message-ID: <66911C8E1F2DA24EB29DE289297A135E1FC06C@usrd104.corp.anacomp.com> Vinita, You are lacking the "-l" lib directives on your link line. You have the "-L" directives which tell the link WHERE to look. But you also need to specify WHICH actual libraries to link in. I don't know a thing about DB2 on NT but my guess is it'll be pretty obvious when you look in If it isn't there is always the DB2 web site which I'm has what you're looking for. Acutally, now that I look closer you seem to have tried to combine bothe functions into a single "-L" directive. Try changing: -L"C:\Program Files\SQLLIB\lib\db2api.lib into -L"C:\Program Files\SQLLIB\lib" -ldb2api.lib Best of luck. Gerard Bras -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Sinha, Vinita Sent: Thursday, August 19, 2004 2:30 PM To: gcc-help@gcc.gnu.org Subject: compile and link a C with embedded SQl program using gcc and DB2 Hi, I am trying to compile a simple sql program using c and DB2 . It fails in the link step.Which are the other Libraries I need to add in the link step to make it work ? This is the bat file for compile @echo off rem Licensed Materials - Property of IBM if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -I"C:\Program Files\SQLLIB\samples\cli" -O0 -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -L"C:\Program Files\SQLLIB\include" -L"C:\Program Files\SQLLIB\lib\db2api.lib" -L"C:\Program Files\SQLLIB\samples\c" -L"C:\Program Files\SQLLIB\bin" -o2006b.exe sqlexample.o goto exit The compile log with errors : C:\R20006\cPrograms>bldappgcc.bat sqlexample Replica1 db2admin db2admin Database Connection Information Database server = DB2/NT 8.1.0 SQL authorization ID = DB2ADMIN Local database alias = REPLICA1 LINE MESSAGES FOR sqlexample.sqc ------ -------------------------------------------------------------------- SQL0060W The "C" precompiler is in progress. SQL0091W Precompilation or binding was ended with "0" errors and "0" warnings. LINE MESSAGES FOR sqlexample.bnd ------ -------------------------------------------------------------------- SQL0061W The binder is in progress. SQL0091N Binding was ended with "0" errors and "0" warnings. DB20000I The SQL command completed successfully. C:\R20006\cPrograms>rem Compile the program. C:\R20006\cPrograms>if exist "sqlexample.cxx" goto cpp_emb C:\R20006\cPrograms>goto link_embedded C:\R20006\cPrograms>gcc -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\ SQLLIB\samples\c" -I"C:\Program Files\SQLLIB\samples\cli" -O0 -g3 -Wall -c -fmes sage-length=0 -osqlexample.o sqlexample.c sqlexample.sqc:73:18: warning: character constant too long for its type sqlexample.sqc:73:30: warning: character constant too long for its type sqlexample.sqc:73:42: warning: character constant too long for its type sqlexample.sqc: In function `main': sqlexample.sqc:73: warning: passing arg 1 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:73: warning: passing arg 2 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:73: warning: passing arg 3 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:87: warning: control reaches end of non-void function sqlexample.sqc: In function `TbBasicSelect': sqlexample.sqc:121: warning: unused variable `rc' C:\R20006\cPrograms>gcc -L"C:\Program Files\SQLLIB\include" -L"C:\Program Files\ SQLLIB\lib\db2api.lib" -L"C:\Program Files\SQLLIB\samples\c" -L"C:\Program File s\SQLLIB\bin" -o2006b.exe sqlexample.o sqlexample.o(.text+0xce): In function `main': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefined reference to `_sqlastr t@12' sqlexample.o(.text+0xfd):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefin ed reference to `_sqlacall@20' sqlexample.o(.text+0x10c):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefi ned reference to `_sqlastop@4' sqlexample.o(.text+0x24a): In function `DbConnect': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undefined reference to `_sqlast rt@12' sqlexample.o(.text+0x271):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x31c):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x34b):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x35a):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlastop@4' sqlexample.o(.text+0x380):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlastrt@12' sqlexample.o(.text+0x3a7):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x406):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x435):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x444):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlastop@4' sqlexample.o(.text+0x4b1): In function `TbBasicSelect': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undefined reference to `_sqlast rt@12' sqlexample.o(.text+0x4d8):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x538):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x567):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x576):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlastop@4' collect2: ld returned 1 exit status C:\R20006\cPrograms>rem link -debug -out:sqlexample.exe sqlexample.obj utilemb.o bj db2api.lib C:\R20006\cPrograms>goto exit The system cannot find the batch label specified - exit C:\R20006\cPrograms> Any help will be appreciated Thanks Vinita From amit2030@yahoo.com Fri Aug 20 11:07:00 2004 From: amit2030@yahoo.com (Amit Choudhary) Date: Fri, 20 Aug 2004 11:07:00 -0000 Subject: Function redefined Message-ID: <20040820064908.2664.qmail@web41114.mail.yahoo.com> Hi All, I am writing a program that includes . int atoi(const char *) is declared in that header file. I am defining (not declaring) atoi again in my program and using it. As I know, standrd C library (libc.so) is linked with the program. 1. Doesn't gcc find the definition twice and shouldn't it report the error? What I found was that it uses the first definition found. 2. Was it always like this or sometime during the course of evolution of compilers, it was decided that the first definition would be used? 3. Or, since it is compiled with dynamic library, it is behaving that way? 4. Would compiling it with static C library (libc.a) would give me a "function redefined" error? Any help would be appreciated a lot as I have become involved in a heated discussion regarding this. Regards, Amit _______________________________ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush From stante@gmail.com Fri Aug 20 11:58:00 2004 From: stante@gmail.com (Alexander Stante) Date: Fri, 20 Aug 2004 11:58:00 -0000 Subject: How to add a new target? Message-ID: <1139247004082001025589168c@mail.gmail.com> Hello, I want to add a new target to the gcc. It has a m68k CPU and I have already written the necessary files like a crt0.S and a linker script to correctly compile on that machine. My goal is that I can build a gcc with for example --target=m68k-mymachine-elf and that the gcc then uses my crt0 and linker script (and a spec file which I still have to write). How can I achieve that? Is there some documentation about that? Bye Alex From laalit_seth@hotmail.com Fri Aug 20 13:20:00 2004 From: laalit_seth@hotmail.com (Lalit Seth) Date: Fri, 20 Aug 2004 13:20:00 -0000 Subject: How to use std::sort function. Message-ID: Hi, How to use std::sort function. I have class CStopWeight which holds a overloaded operator < to sort the list in Descending Order. I hve a vector stopWeight which hold the Objects of CStopWeight. I needed to sort them in Descending Order. How can I call the operator < in the std::sort function. I tried std::sort(stopWeight.begin(),stopWeight.end(),CStopWeight< stopWeight) but doesn't work. How can this be done. As I m compiling a code written in VC++ for linux using gcc. Earlier there was a statement which was written but doesn't work. It was std::sort(stopWeight.begin(), &stopWeight[stopWeight.size()]); I don't know what this meant. Some Code Segment below. Many thanks Lalit class CStopWeight { public: int m_originalStop; // original stop //~AC_STOP_SEQ int m_stop; // current T3 stop sequence number //~AC_STOP_SEQ std::string m_order; // order ID //~AC_STOP_SEQ int m_numStacks; // number of stacks in the stop(order) //~AC_STOP_SEQ std::vector m_stackWeight; // weights for each stack in the order. //~AC_STOP_SEQ // cummulativeStackWeight[0] is 1st stack only, cummulativeStackWeight[1] is 1st and 2nd stack etc //~AC_STOP_SEQ CStopWeight(int originalStop, int stop, std::string order, int numStacks) {m_originalStop = originalStop; m_stop = stop; m_order = order; m_numStacks = numStacks; m_stackWeight.clear();}; //~AC_STOP_SEQ ~CStopWeight() {m_stackWeight.clear();}; //~AC_STOP_SEQ // declare the following CStopWeight operators so can use the std::sort function. Note the < operator is set up such that it will sort DESCENDING friend bool operator==(const CStopWeight& stop1, const CStopWeight& stop2); //~AC_STOP_SEQ friend bool operator<(const CStopWeight& stop1, const CStopWeight& stop2); //~AC_STOP_SEQ private: }; ====================================== std::vector stopWeight; // holds stack weights and other info to allow stops weights to be compared std::vector::iterator stopIterator; // iterator // Sort the stops DESC. Heavier stops will be sorted to the front // of , ligher stops to the rear. // Note the "<" operator for CStopWeight was overloaded to sort DESC. // - Assumes stacks sorted within the stop by weight (note: mixed stacks will appear at the front/end of the stop regardless of weight) // - Assumes every stack has the same width/length (and ignores turns). std::sort(stopWeight.begin(), &stopWeight[stopWeight.size()]); //---------------------------------------------------------- // CStopWeight::operator== // Returns true if the axle weights for stop 1 placed before // stop 2 are the same as if stop 1 had been placed after // stop 2 // //---------------------------------------------------------- bool operator==(const CStopWeight& stop1, const CStopWeight& stop2) { int stop1Size; int stop2Size; int i; double axleWeight1; double axleWeight2; stop1Size = stop1.m_stackWeight.size(); stop2Size = stop2.m_stackWeight.size(); // Stop 1 before Stop 2 axleWeight1 = 0.0; for (i = 0; i < stop1Size; i++) { axleWeight1 += (stop1Size + stop2Size - i) * stop1.m_stackWeight.at(i); } for (i = 0; i < stop2Size; i++) { axleWeight1 += (stop2Size - i) * stop2.m_stackWeight.at(i); } // Stop 2 before Stop 1 axleWeight2 = 0.0; for (i = 0; i < stop2Size; i++) { axleWeight2 += (stop1Size + stop2Size - i) * stop2.m_stackWeight.at(i); } for (i = 0; i < stop1Size; i++) { axleWeight2 += (stop1Size - i) * stop1.m_stackWeight.at(i); } return axleWeight1 == axleWeight2; } //---------------------------------------------------------- // CStopWeight::operator< // Returns true if the axle weights for stop 1 placed before // stop 2 would be larger (NOT smaller!). Note sign // reversal because we want to sort DESCENDING not ASCENDING. //---------------------------------------------------------- bool operator<(const CStopWeight& stop1, const CStopWeight& stop2) { int stop1Size; int stop2Size; int i; double axleWeight1; double axleWeight2; stop1Size = stop1.m_stackWeight.size(); stop2Size = stop2.m_stackWeight.size(); // Stop 1 before Stop 2 axleWeight1 = 0.0; for (i = 0; i < stop1Size; i++) { axleWeight1 += (stop1Size + stop2Size - i) * stop1.m_stackWeight.at(i); } for (i = 0; i < stop2Size; i++) { axleWeight1 += (stop2Size - i) * stop2.m_stackWeight.at(i); } // Stop 2 before Stop 1 axleWeight2 = 0.0; for (i = 0; i < stop2Size; i++) { axleWeight2 += (stop1Size + stop2Size - i) * stop2.m_stackWeight.at(i); } for (i = 0; i < stop1Size; i++) { axleWeight2 += (stop1Size - i) * stop1.m_stackWeight.at(i); } return axleWeight1 > axleWeight2; } _________________________________________________________________ Sell what you don??t Need. We help you Ship it out. http://go.msnserver.com/IN/54179.asp Click Here! From eljay@adobe.com Fri Aug 20 15:02:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 20 Aug 2004 15:02:00 -0000 Subject: Function redefined In-Reply-To: <20040820064908.2664.qmail@web41114.mail.yahoo.com> References: <20040820064908.2664.qmail@web41114.mail.yahoo.com> Message-ID: <6.1.2.0.2.20040820065044.01e73440@iplan-mn.corp.adobe.com> Hi Amit, >1. Doesn't gcc find the definition twice and shouldn't it report the error? No. Definitions in your object code supersede definitions in archive libraries and shared object libraries. If not careful, antics and hilarity can ensue. What I found was that it uses the first definition found. >2. Was it always like this or sometime during the course of evolution of compilers, it was decided that the first definition would be used? It's been like that as long as I'm aware. But I've only been programming for 28 years. Maybe in the good old days before I started programming it was different. Or maybe it's different on platforms other than the ones I'm familiar with. >3. Or, since it is compiled with dynamic library, it is behaving that way? Yes, dynamic libraries (SSO) behave that way, although DSO's do not. SSO - static shared object DSO - dynamic shared object You can list out your executable's SSO's using the ldd command. DSO's explicitly use the dlopen and manually match symbols up from the shared object library. You could use a DSO to access the atoi function in the library, even if you have an SSO or executable that has defined a different atoi function. >4. Would compiling it with static C library (libc.a) would give me a "function redefined" error? No. Your object code supersedes both shared object libraries and archive libraries. (There are tricks to make that not happen, but you'd have to take measures and fiddle with some of the compiler/linker options.) HTH, --Eljay From ankitjain1580@yahoo.com Fri Aug 20 21:13:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Fri, 20 Aug 2004 21:13:00 -0000 Subject: gcc+asm Message-ID: <20040820132039.43243.qmail@web52907.mail.yahoo.com> hi i want to know the difference b/w the following instrutions "movq (%1),(%0) \n" "movq %1, %0 \n" basic question is what is bracket doing with the operands. does it have some significance? thanks ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From ER120834@teradata-ncr.com Fri Aug 20 21:46:00 2004 From: ER120834@teradata-ncr.com (Ray, Edmond) Date: Fri, 20 Aug 2004 21:46:00 -0000 Subject: Trying to build on UNIX V.4 Message-ID: <6B90E33D6C66D3119C7D00E029265322160C88AF@susdayte01.daytonoh.ncr.com> I am trying to build gcc on a version of UNIX V.4 called MP-RAS. The build seems to be going fine until what looks like the final link. I get the following error: /usr/gnu/bin/gcc -g -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -DHAVE_CONFIG_H -o Tcollect2 \ collect2.o tlink.o intl.o version.o ../libiberty/libiberty.a ../intl/libintl.a -lld /usr/gnu/bin/ld: Tcollect2: Not enough room for program headers (allocated 5, need 6) /usr/gnu/bin/ld: final link failed: Bad value make[2]: *** [collect2] Error 1 make[2]: Leaving directory `/home/ed/GNU/gcc-3.4.0/gcc' make[1]: *** [stage1_build] Error 2 make[1]: Leaving directory `/home/ed/GNU/gcc-3.4.0/gcc' make: *** [bootstrap] Error 2 Can someone help me PLEASE. Edmond Ray Senior Data Warehouse Consultant Special Programs, NCR Government Systems From Vinita_Sinha@tesseract.com Fri Aug 20 22:07:00 2004 From: Vinita_Sinha@tesseract.com (Sinha, Vinita) Date: Fri, 20 Aug 2004 22:07:00 -0000 Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Message-ID: <92F42ACDF6EDA547BA003A49A68A651E0ED0BD@tessmail.tesseract.com> Hi, I have a embedded sql C program compiled and bound using gcc version 3.3.1 . It goes againat udb/db2 version 8.1 . I am getting the following error when trying to execute the program . Is there something I am missing or is it a known issue on which I can get some help . Exception: STATUS_ACCESS_VIOLATION at eip=610D39A1 eax=00000000 ebx=00000000 ecx=FFFFFFFF edx=FFFFFFFF esi=00000000 edi=FFFFFFFF ebp=0022D708 esp=0022D704 program=C:\R20006\cPrograms\2006l.exe, pid 2088, thread main cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023 Stack trace: Frame Function Args 0022D708 610D39A1 (FFFFFFFF, 0022D7DE, 00401228, 00000001) 0022EE58 610D77FC (0022F208, 6111B310, 00401219, 0022EEA8) 0022EE78 610D6F05 (6111B310, 00401219, 0022EEA4, 0A051000) 0022EE98 610E4837 (00401219, FFFFFFFF, 00000000, 6111B374) 0022EF88 6108DF2F (69636131, 646D696E, 646D696E, 610F3EA0) 0022F058 004010EE (00000001, 0A050190, 0A0500A8, 00000001) 0022F0A8 61005F54 (0022F0C0, FFFFFFFF, 0A016A30, 0A016C44) 0022FF88 6100616B (00000000, 00000000, 00000000, 00000000) End of stack trace This is what I used to compile , bind the program and create the executable . @echo off if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -m32 -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -m32 -L"C:\Program Files\SQLLIB\lib" -L"C:\Program Files\SQLLIB\include" -o"2006l.exe" sqlexample.o utilemb.o "C:\Program Files\SQLLIB\lib\db2api.lib" goto exit Thanks From gbras@anacomp.com Sat Aug 21 04:35:00 2004 From: gbras@anacomp.com (Bras, Gerard) Date: Sat, 21 Aug 2004 04:35:00 -0000 Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Message-ID: <66911C8E1F2DA24EB29DE289297A135E1FC07D@usrd104.corp.anacomp.com> Vinita, You have at least one bug in your program, a wild guess on my part is that it's a bad pointer, probably uninitialized. You need to make friends with the debug utility, there are some very good ones now which will let you work at the source code level. If you have gcc available then you may very well also have gdb. In any case this is the kind of problem that needs to be looked at first hand (the source code) and I'm not sure this is the right group for that. I urge you to find an experienced programmer and beg/plead/bribe him/her to walk you through solving this kind of problem. It's one of those skills that will last you a lifetime. Best of luck, Gerard -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Sinha, Vinita Sent: Friday, August 20, 2004 5:13 PM To: gcc-help@gcc.gnu.org Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Hi, I have a embedded sql C program compiled and bound using gcc version 3.3.1 . It goes againat udb/db2 version 8.1 . I am getting the following error when trying to execute the program . Is there something I am missing or is it a known issue on which I can get some help . Exception: STATUS_ACCESS_VIOLATION at eip=610D39A1 eax=00000000 ebx=00000000 ecx=FFFFFFFF edx=FFFFFFFF esi=00000000 edi=FFFFFFFF ebp=0022D708 esp=0022D704 program=C:\R20006\cPrograms\2006l.exe, pid 2088, thread main cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023 Stack trace: Frame Function Args 0022D708 610D39A1 (FFFFFFFF, 0022D7DE, 00401228, 00000001) 0022EE58 610D77FC (0022F208, 6111B310, 00401219, 0022EEA8) 0022EE78 610D6F05 (6111B310, 00401219, 0022EEA4, 0A051000) 0022EE98 610E4837 (00401219, FFFFFFFF, 00000000, 6111B374) 0022EF88 6108DF2F (69636131, 646D696E, 646D696E, 610F3EA0) 0022F058 004010EE (00000001, 0A050190, 0A0500A8, 00000001) 0022F0A8 61005F54 (0022F0C0, FFFFFFFF, 0A016A30, 0A016C44) 0022FF88 6100616B (00000000, 00000000, 00000000, 00000000) End of stack trace This is what I used to compile , bind the program and create the executable . @echo off if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -m32 -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -m32 -L"C:\Program Files\SQLLIB\lib" -L"C:\Program Files\SQLLIB\include" -o"2006l.exe" sqlexample.o utilemb.o "C:\Program Files\SQLLIB\lib\db2api.lib" goto exit Thanks From Vinita_Sinha@tesseract.com Sat Aug 21 11:44:00 2004 From: Vinita_Sinha@tesseract.com (Sinha, Vinita) Date: Sat, 21 Aug 2004 11:44:00 -0000 Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Message-ID: <92F42ACDF6EDA547BA003A49A68A651E0B2D42@tessmail.tesseract.com> It really is a sample program provided by IBM to connect to DB2 so I am not sure why that should be buggy. I will try another one and then debug . Thanks Vinita -----Original Message----- From: Bras, Gerard [mailto:gbras@anacomp.com] Sent: Friday, August 20, 2004 2:46 PM To: Sinha, Vinita; gcc-help@gcc.gnu.org Subject: RE: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Vinita, You have at least one bug in your program, a wild guess on my part is that it's a bad pointer, probably uninitialized. You need to make friends with the debug utility, there are some very good ones now which will let you work at the source code level. If you have gcc available then you may very well also have gdb. In any case this is the kind of problem that needs to be looked at first hand (the source code) and I'm not sure this is the right group for that. I urge you to find an experienced programmer and beg/plead/bribe him/her to walk you through solving this kind of problem. It's one of those skills that will last you a lifetime. Best of luck, Gerard -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Sinha, Vinita Sent: Friday, August 20, 2004 5:13 PM To: gcc-help@gcc.gnu.org Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Hi, I have a embedded sql C program compiled and bound using gcc version 3.3.1 . It goes againat udb/db2 version 8.1 . I am getting the following error when trying to execute the program . Is there something I am missing or is it a known issue on which I can get some help . Exception: STATUS_ACCESS_VIOLATION at eip=610D39A1 eax=00000000 ebx=00000000 ecx=FFFFFFFF edx=FFFFFFFF esi=00000000 edi=FFFFFFFF ebp=0022D708 esp=0022D704 program=C:\R20006\cPrograms\2006l.exe, pid 2088, thread main cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023 Stack trace: Frame Function Args 0022D708 610D39A1 (FFFFFFFF, 0022D7DE, 00401228, 00000001) 0022EE58 610D77FC (0022F208, 6111B310, 00401219, 0022EEA8) 0022EE78 610D6F05 (6111B310, 00401219, 0022EEA4, 0A051000) 0022EE98 610E4837 (00401219, FFFFFFFF, 00000000, 6111B374) 0022EF88 6108DF2F (69636131, 646D696E, 646D696E, 610F3EA0) 0022F058 004010EE (00000001, 0A050190, 0A0500A8, 00000001) 0022F0A8 61005F54 (0022F0C0, FFFFFFFF, 0A016A30, 0A016C44) 0022FF88 6100616B (00000000, 00000000, 00000000, 00000000) End of stack trace This is what I used to compile , bind the program and create the executable . @echo off if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -m32 -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -m32 -L"C:\Program Files\SQLLIB\lib" -L"C:\Program Files\SQLLIB\include" -o"2006l.exe" sqlexample.o utilemb.o "C:\Program Files\SQLLIB\lib\db2api.lib" goto exit Thanks From jiayu@huawei.com Sat Aug 21 11:52:00 2004 From: jiayu@huawei.com (jiayu 33576) Date: Sat, 21 Aug 2004 11:52:00 -0000 Subject: Two additional errors of GCC 2.96 Message-ID: <6e9e1201.12016e9e@huawei.com> The problem we meeted last have not solved. The code is so large and I am trying to simplify it. We meeted two additional problems.All the errors took place when we were compiling C or C++ using Tornado 2.2 for MIPS. The compiler is GCC 2.96 suppiled by WindRiver. Please help us! Thanks a lot 1. The compiler can't compare an element of enum and an unsigned short variable Error information: ../../../src/momu/src/mnt/cmnt_int.cpp:3736: Internal compiler error in `copy_to_mode_reg', at explow.c:710 cmnt_int.cpp:3736: if ( LID_OMU != g_uwLogicBoardType ) /* Error occurs here */ { vos_printf("error"); } The related defination: typedef enum { LID_OMU = 0x0100, /*256 MOMU,FOMU*/ ... } VOS_UINT16 g_uwLogicalBoardNo = VOS_NULL_WORD; typedef unsigned short VOS_UINT16; #define VOS_NULL_WORD 0xFFFF 2. The compiler can't assign by structure ../../../src/momu/src/mnt/cmnt_int.cpp:3751: Internal compiler error in `move_by_pieces', at expr.c:1505 cmnt_int.cpp:3751 struct tmp a,b; a.time = b.time; /* Error occurs here */ The related defination: #pragma pack(1) struct tmp { VOS_UINT32 a; SYS_T time; }; #pragma pack(4) name: jiayu email: jiayu@huawei.com ************************************************************** This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! ************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: j33576.vcf Type: text/x-vcard Size: 86 bytes Desc: Card for jiayu 33576 URL: From qbvfd@yahoo.com Sat Aug 21 16:05:00 2004 From: qbvfd@yahoo.com (Milford Pruitt) Date: Sat, 21 Aug 2004 16:05:00 -0000 Subject: Fw: edwina Message-ID: I had received this this morning, did you sign up for this yet? http://www.inetcontact.com/ref44.html You can grab music, like full CD albums, and games & movies. I was able to find at least 66 of my favorite CD's You should get a load of how many movies are in here that'l play in your dvd player - it's crazy. They walk you through the entire process of burning them to CD. I noticed in the movie section over lunch, they have titles for download that are still in theaters - it's fantastic. I'll see you next Friday at the get together. Amalia ----44249399925255834325---- From eljay@adobe.com Sat Aug 21 19:28:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Sat, 21 Aug 2004 19:28:00 -0000 Subject: Two additional errors of GCC 2.96 In-Reply-To: <6e9e1201.12016e9e@huawei.com> References: <6e9e1201.12016e9e@huawei.com> Message-ID: <6.1.2.0.2.20040821064243.01e41978@iplan-mn.corp.adobe.com> Jiayu, I recommend upgrading to the most current version of GCC. Either GCC 3.4.1 (latest and greatest), or GCC 3.3.4 (yesterday's tried and true). There is no "GCC 2.96". It's an unofficial, maverick release of GCC by Red Hat. It's not supported on this forum (although we do give some general advice). Your code snippets are incomplete. Is your enum supposed to be missing the terminating semicolon (and thus typedefing to VOS_UINT16)? If so, have you tried separating out g_uwLogicalBoardNo variable from the typedef? Is your VOS_NULL_WORD define supposed to come AFTER it is being used? Is your typedef of VOS_UINT16 supposed to come AFTER it is being used? For your "compiler can't assign by structure"... Is there a good reason to override the platform recommended packing, which can cause errors such as "Internal compiler error in 'move_by_pieces'"? HTH, --Eljay From jiayu@huawei.com Sun Aug 22 04:50:00 2004 From: jiayu@huawei.com (jiayu 33576) Date: Sun, 22 Aug 2004 04:50:00 -0000 Subject: Two additional errors of GCC 2.96 Message-ID: <1329d1121e.1121e1329d@huawei.com> The Gcc 2.96 is provided by WindRiver with it's tool Tornado, which is GUI tool for vxworks. I don't how the version number 2.96 come from. It's just the result of "gcc -v". I have contact with Wind River. I am not very familiar with gcc. Is it easy to change my gcc to 3.3.4? Does it perform just like the one provided by WindRiver? Thanks a lot! name: jiayu email: jiayu@huawei.com ************************************************************** This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! ************************************************************** ----- Original Message ----- From: Eljay Love-Jensen Date: Saturday, August 21, 2004 7:52 pm Subject: Re: Two additional errors of GCC 2.96 > Jiayu, > > I recommend upgrading to the most current version of GCC. Either > GCC 3.4.1 > (latest and greatest), or GCC 3.3.4 (yesterday's tried and true). > > There is no "GCC 2.96". It's an unofficial, maverick release of > GCC by Red > Hat. It's not supported on this forum (although we do give some > general > advice). > > Your code snippets are incomplete. > > Is your enum supposed to be missing the terminating semicolon (and > thus > typedefing to VOS_UINT16)? If so, have you tried separating out > g_uwLogicalBoardNo variable from the typedef? > > Is your VOS_NULL_WORD define supposed to come AFTER it is being used? > > Is your typedef of VOS_UINT16 supposed to come AFTER it is being used? > > For your "compiler can't assign by structure"... > > Is there a good reason to override the platform recommended > packing, which > can cause errors such as "Internal compiler error in > 'move_by_pieces'"? > HTH, > --Eljay > > -------------- next part -------------- A non-text attachment was scrubbed... Name: j33576.vcf Type: text/x-vcard Size: 86 bytes Desc: Card for jiayu 33576 URL: From squirrel@_HOSTNAME_.headnut.org Sun Aug 22 05:12:00 2004 From: squirrel@_HOSTNAME_.headnut.org (squirrel@_HOSTNAME_.headnut.org) Date: Sun, 22 Aug 2004 05:12:00 -0000 Subject: problem bootstrapping gcc 3.4.1 Message-ID: <20040821192808.GA7150@ivanova.headnut.org> hey, i'm trying to bootstrap gcc 3.4.1 with uclibc for an embedded device toolchain, but i keep getting errors upon the compile. the relevant lines: $ tar xfj gcc-3.4.1.tar.gz $ mkdir build-boot-gcc $ cd build-boot-gcc $ ../gcc-3.4.1/configure --target=i386-linux \ --prefix=/home/squirrel/projects/stb_pbx/toolchain \ --without-headers \ --with-newlib \ --disable-nls \ --enable-languages=c $ make all-gcc /home/squirrel/projects/stb_pbx/build-tools/build-boot-gcc/gcc/xgcc -B/home/squirrel/projects/stb_pbx/build-tools/build-boot-gcc/gcc/ -B/home/squirrel/projects/stb_pbx/tools/i386-linux/bin/ -B/home/squirrel/projects/stb_pbx/tools/i386-linux /lib/ -isystem /home/squirrel/projects/stb_pbx/tools/i386-linux/include -isystem /home/squirrel/projects/stb_pbx/tools/i386-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-3.4.1/gcc -I../../gcc-3.4.1/gcc/. -I../../gcc-3.4.1/gcc/../include -DL_muldi3 -c ../../gcc-3.4.1/gcc/libgcc2.c -o libgcc/./_muldi3.o In file included from ./tm.h:11, from ../../gcc-3.4.1/gcc/libgcc2.c:43: ../../gcc-3.4.1/gcc/config/i386/linux.h:217:20: signal.h: No such file or directory ../../gcc-3.4.1/gcc/config/i386/linux.h:218:26: sys/ucontext.h: No such file or directory make[2]: *** [libgcc/./_muldi3.o] Error 1 any help on fixing this issue is greatly appreciated! please e-mail directly or cc me in the reply as i am not on the gcc-help list. thank you! chris From dynamicppl04@yahoo.com Sun Aug 22 13:35:00 2004 From: dynamicppl04@yahoo.com (dynamic ppl) Date: Sun, 22 Aug 2004 13:35:00 -0000 Subject: asm errors Message-ID: <20040822045047.88064.qmail@web53203.mail.yahoo.com> Hi Folks, Can some one shed some light on this? I am trying to compile a package named tmpi and in one particular file i get this error and the person who wrote the code is unable to help. gcc version : 3.2.2 20030222 Processor : Athlon. __inline__ int cas32(volatile int *addr, int old, int new) { char ret; __asm__ __volatile__(LOCK_PREFIX "cmpxchg %2, %1\n\t" /* swap values if current value is known */ "sete %0" /* read success/fail from EF */ : "=q" (ret), "=m" (ADDR) : "r" (new), "a" (old) : "%eax" ); return (int)ret; } error: ---------- make[3]: [clean] Error 1 (ignored) cc -O -Wall -I. -D__SMP__ -c -o atomic.o atomic.c atomic.c: In function `casp': atomic.c:28: warning: cast from pointer to integer of different size atomic.c:28: warning: cast from pointer to integer of different size atomic.c: In function `cas32': atomic.c:7: can't find a register in class `AREG' while reloading `asm' make: *** [atomic.o] Error 1 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From dynamicppl04@yahoo.com Mon Aug 23 09:44:00 2004 From: dynamicppl04@yahoo.com (dynamic ppl) Date: Mon, 23 Aug 2004 09:44:00 -0000 Subject: Assembly errors : compiling Message-ID: <20040822051233.22864.qmail@web53210.mail.yahoo.com> Hi Folks, Sorry for my earlier mail, which did not have the current fuction that was giving the problem. here it is __inline__ int casp(void * *pval, void * old, void * new) { /** * somehow I have to decide the size of (void *) * during the runtime. */ if (sizeof(void *)==sizeof(int)) return cas32((int*)pval, (int)old, (int)new); else return cas64((long long *)pval, (long long)old, (long long)new); } error : cc -O -Wall -I. -D__SMP__ -c -o atomic.o atomic.c atomic.c: In function `casp': atomic.c:28: warning: cast from pointer to integer of different size atomic.c:28: warning: cast from pointer to integer of different size atomic.c: In function `cas32': atomic.c:7: can't find a register in class `AREG' while reloading `asm' make: *** [atomic.o] Error 1 thank you, with regards Shiva _______________________________ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com From rollos@starband.net Mon Aug 23 11:11:00 2004 From: rollos@starband.net (RolloS) Date: Mon, 23 Aug 2004 11:11:00 -0000 Subject: where to install gcc 3.3? Message-ID: <249D0688-F440-11D8-9301-000393D7297A@starband.net> I have downloaded gcc-3-3 to /Developer/Documentation/DeveloperTools/ on my Powermac G4 running OS X 10.2.8, with Decembe 2002 developer tools. Is that the right place for it? Does it matter what directory it is in? Do I need to do any installation, other than moving it to the right place? --Roland Silver -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 382 bytes Desc: not available URL: From andrea_pretto@yahoo.it Mon Aug 23 13:40:00 2004 From: andrea_pretto@yahoo.it (Andrea Pretto) Date: Mon, 23 Aug 2004 13:40:00 -0000 Subject: Help with specs In-Reply-To: References: Message-ID: <1093254518.792.4.camel@debian-host> In my spec , I have changed my cpp line in this way: *cpp: %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} -D_INCLUDE__STDC_A1_SOURCE That is, I have appended -D_INCLUDE__STDC_A1_SOURCE, and this code #include int main ( void ){ #ifdef _INCLUDE__STDC_A1_SOURCE printf("Yes\n"); #else printf("No\n"); #endif return 0; } print "Yes" string. It seem correct. On Mon, 2004-08-16 at 21:24, DY, JERRY U (SBCSI) wrote: > Here's my config: > > g++ -v > Reading specs from > /usr/local/appl/gcc-3.4.1/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.1/specs > Configured with: ../gcc-3.4.1/configure --prefix=/usr/local/appl/gcc > --with-as=/usr/local/appl/binutils/bin/as --enable-threa > ds=posix > Thread model: posix > gcc version 3.4.1 > > I wanted to change the specs so that -D_INCLUDE__STDC_A1_SOURCE is > defined everytime the precompiler is invoked, so I modify the cpp entry > in the specs file as follows: > > *cpp: > -D_INCLUDE__STDC_A1_SOURCE %{mt|pthread:-D_REENTRANT -D_THREAD_SAFE > -D_POSIX_C_SOURCE=199506L} > > But it doesn't appear to be working. Is there something wrong with my > syntax or am I missing something? Thanks! > > -Jerry From julien.finet@tremplin-utc.net Mon Aug 23 13:43:00 2004 From: julien.finet@tremplin-utc.net (julien.finet@tremplin-utc.net) Date: Mon, 23 Aug 2004 13:43:00 -0000 Subject: How compile for another platform Message-ID: <1093259505.4129d0f1f0af4@mailetu.utc.fr> Hello, I know it is possible to compile for Mac on Linux(or windows), but how? Thanks for your help ! Julien. From betus@visa.com Mon Aug 23 16:48:00 2004 From: betus@visa.com (Betu, Satyanarayana) Date: Mon, 23 Aug 2004 16:48:00 -0000 Subject: sizeof(bool) Message-ID: Hello Sir, we are using g++ 2.95.3 .Currently we are facing problems with data type bool.Programs compiling with this compiler are taking bool size as 4 because of which we are not able to prote this application to another machines.Do u have any patch for this problem? Thanks & Regards Satya VISA - VDPS Development IT Division Basingstoke LONDON +44 1256 89 1541 (O) From hueffner@informatik.uni-tuebingen.de Tue Aug 24 01:41:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Tue, 24 Aug 2004 01:41:00 -0000 Subject: sizeof(bool) In-Reply-To: (Satyanarayana Betu's message of "Mon, 23 Aug 2004 14:39:56 +0100") References: Message-ID: <87brh2ynpq.fsf@informatik.uni-tuebingen.de> "Betu, Satyanarayana" writes: > we are using g++ 2.95.3 .Currently we are facing problems with data > type bool.Programs compiling with this compiler are taking bool size > as 4 because of which we are not able to prote this application to > another machines.Do u have any patch for this problem? The C++ standard allows bool to have size 4, so there is no problem in g++; the problem is in your application. However, you might consider upgrading to a current version of g++, where the size of bool is 1 consistently over all architectures. -- Falk From iainw@nortelnetworks.com Tue Aug 24 05:23:00 2004 From: iainw@nortelnetworks.com (Iain Woolf) Date: Tue, 24 Aug 2004 05:23:00 -0000 Subject: Two additional errors of GCC 2.96 References: <6e9e1201.12016e9e@huawei.com> Message-ID: <412A1FC4.66A6CAA7@americasm01.nt.com> jiayu 33576 wrote: > > The problem we meeted last have not solved. The code is so large and I > am trying to simplify it. We meeted two additional problems.All the > errors took place when we were compiling C or C++ using Tornado 2.2 > for MIPS. The compiler is GCC 2.96 suppiled by WindRiver. Please help > us! Thanks a lot > > 1. The compiler can't compare an element of enum and an unsigned short > variable > Error information: > ../../../src/momu/src/mnt/cmnt_int.cpp:3736: Internal compiler error > in `copy_to_mode_reg', at explow.c:710 > > cmnt_int.cpp:3736: > if ( LID_OMU != g_uwLogicBoardType ) /* Error occurs here */ > { > vos_printf("error"); > } > > The related defination: > typedef enum > { > LID_OMU = 0x0100, /*256 MOMU,FOMU*/ > ... > } > VOS_UINT16 g_uwLogicalBoardNo = VOS_NULL_WORD; > typedef unsigned short VOS_UINT16; > #define VOS_NULL_WORD 0xFFFF You say the error occurs on the line with g_uwLogicBoardType, but you supply a definition for g_uwLogicalBoardNo. I have the same compiler and tried the following sample code. It compiled fine //------------------------------------------------------ #include #define VOS_NULL_WORD 0xFFFF typedef unsigned short VOS_UINT16; VOS_UINT16 g_uwLogicalBoardNo = VOS_NULL_WORD; typedef enum { LID_OMU = 0x0100, /*256 MOMU,FOMU*/ }; void somefn(void) { if ( LID_OMU != g_uwLogicalBoardNo ) /* No error here */ { printf("error"); } } //------------------------------------------------------ > 2. The compiler can't assign by structure > ../../../src/momu/src/mnt/cmnt_int.cpp:3751: Internal compiler error > in `move_by_pieces', at expr.c:1505 I don't see why it would give you an internal compiler error, but gcc2.96 (Windriver's compiler based on GNU's gcc2.95) is more ANSI compliant than the previous version of the Windriver compiler (gcc2.72). One of the restrictions is not being able to assign one structure to another. Presumably this is why you have a function called "move_by_pieces". You didn't provide the definition for SYS_T, but I'm guessing this is a structure itself. Cheers, Iain From LiuM@star-net.cn Tue Aug 24 08:08:00 2004 From: LiuM@star-net.cn (Markle Liu) Date: Tue, 24 Aug 2004 08:08:00 -0000 Subject: how to compiler a cross compiler for MPC8540 on the cygwin? Message-ID: Hi all, I had spent lot of time on building a cross compiler for MPC8540 on the cygwin. and i had try serval combination of gcc, binutilis and gdb, but all failed. my project would running on MPC8540 target without OS, and i need gcc, gdb and insight to develop and debug on the target. thanx ? ?? ?? ???????? ?????????????? ====================================================== Email: Lium@star-net.cn Tel: +86 (591) 83057579 Fax: +86 (591) 83057866 URL: http://www.star-net.cn Addr: ???????618????20#-22#??????? Postcode: 350002 ====================================================== From janvier_anonical@yahoo.com Tue Aug 24 10:47:00 2004 From: janvier_anonical@yahoo.com (=?iso-8859-1?q?Janvier=20D.=20Anonical?=) Date: Tue, 24 Aug 2004 10:47:00 -0000 Subject: Two gcc Installations: conflict in library? Message-ID: <20040824052329.32638.qmail@web52104.mail.yahoo.com> Hello! Currently, my gcc (3.3.3) is installed in /usr. I have installed a new gcc (3.4.1) in /usr/local. Now, whenever I do 'gcc --version' the compiler being used is the new one (3.4.1). My questions is this. Which header files (e.g., stdio.h, iostream, etc.) and libraries (e.g., libstdc++, libgcc, etc.) lib will be used by default? Is it the one in /usr/local or the one in /usr? Thanks! ===== Last night as I lay in bed looking at the stars I thought: 'Where the hell is ceiling?' ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From eljay@adobe.com Tue Aug 24 10:54:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 24 Aug 2004 10:54:00 -0000 Subject: Two gcc Installations: conflict in library? In-Reply-To: <20040824052329.32638.qmail@web52104.mail.yahoo.com> References: <20040824052329.32638.qmail@web52104.mail.yahoo.com> Message-ID: <6.1.2.0.2.20040824030733.01e91178@iplan-mn.corp.adobe.com> Hi Janvier, When you compile, put in the -v switch. g++ -v test.cpp The verbose output will state which header file locations and libraries are being used. HTH, --Eljay From eljay@adobe.com Tue Aug 24 16:27:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 24 Aug 2004 16:27:00 -0000 Subject: g++ and null pointers Message-ID: <6.1.2.0.2.20040824053102.01e9b890@iplan-mn.corp.adobe.com> Hi everyone, GCC 3.3.1 on Cygwin When I compile this test.cpp source... // g++ -Wno-long-long -pedantic -Wall -W -c test.cpp #define NULL __null int main() { void* p; p = 0; p = 0u; p = 0ul; p = 0ull; p = 0l; p = 0ll; p = false; // silly... p = -0; p = -0u; p = -0ul; p = -0ull; p = -0l; p = -0ll; p = -false; // my druthers... p = NULL; return 0; } ...GCC is happy with all of these assignments. Are they all supposed (ISO 14882) to be legit? Some of them surprised me. The negated ones are just for fun. I didn't go completely crazy with the cheese whiz, and put in "!!0" and "+0" and hexadecimal, and octal, and various permutations of the [uUlL]* suffix. Sincerely, --Eljay From hueffner@informatik.uni-tuebingen.de Tue Aug 24 17:18:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Tue, 24 Aug 2004 17:18:00 -0000 Subject: g++ and null pointers In-Reply-To: <6.1.2.0.2.20040824053102.01e9b890@iplan-mn.corp.adobe.com> (Eljay Love-Jensen's message of "Tue, 24 Aug 2004 05:47:46 -0500") References: <6.1.2.0.2.20040824053102.01e9b890@iplan-mn.corp.adobe.com> Message-ID: <87eklwajso.fsf@informatik.uni-tuebingen.de> Eljay Love-Jensen writes: > When I compile this test.cpp source... > > // g++ -Wno-long-long -pedantic -Wall -W -c test.cpp > #define NULL __null > int main() > { > void* p; > p = 0; > p = 0u; > p = 0ul; > p = 0ull; > p = 0l; > p = 0ll; > p = false; > // silly... > p = -0; > p = -0u; > p = -0ul; > p = -0ull; > p = -0l; > p = -0ll; > p = -false; > // my druthers... > p = NULL; > return 0; > } > > ...GCC is happy with all of these assignments. > > Are they all supposed (ISO 14882) to be legit? Some of them surprised me. The standard says that a null pointer constant is "[a]n integer constant expression with the value 0", so these seem all OK. -- Falk From lrtaylor@micron.com Tue Aug 24 18:27:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Tue, 24 Aug 2004 18:27:00 -0000 Subject: Two gcc Installations: conflict in library? Message-ID: <363801FFD7B74240A329CEC3F7FE4CC40309610B@ntxboimbx07.micron.com> Mostly likely, when you compile, the new libraries and headers will get picked up. However, depending on how your LD_LIBRARY_PATH (or ld.so.conf on Linux) is set up, you may not get the right libraries - it will depend on whether /usr/lib is search before /usr/local/lib. I would suspect that /usr/local/lib is searched first, but it just depends on how your system is set up. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Janvier D. Anonical Sent: Monday, August 23, 2004 11:23 PM To: gcc-help@gcc.gnu.org Subject: Two gcc Installations: conflict in library? Hello! Currently, my gcc (3.3.3) is installed in /usr. I have installed a new gcc (3.4.1) in /usr/local. Now, whenever I do 'gcc --version' the compiler being used is the new one (3.4.1). My questions is this. Which header files (e.g., stdio.h, iostream, etc.) and libraries (e.g., libstdc++, libgcc, etc.) lib will be used by default? Is it the one in /usr/local or the one in /usr? Thanks! ===== Last night as I lay in bed looking at the stars I thought: 'Where the hell is ceiling?' ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From iainw@nortelnetworks.com Wed Aug 25 19:30:00 2004 From: iainw@nortelnetworks.com (Iain Woolf) Date: Wed, 25 Aug 2004 19:30:00 -0000 Subject: *.gperf files in gcc directories? Message-ID: <412B784D.3020704@americasm01.nt.com> Hi all, I see a number of gperf files in the gcc source directory: ./gcc/ch/gperf ./gcc/cp/gxx.gperf ./gcc/c-gperf.h ./gcc/c-parse.gperf ./gcc/java/keyword.gperf ./gcc/objc/objc.gperf And I notice that some header files have been produced by calling gperf on these files with various options. However, the gperf step isn't part of the build, so my question is when should one "re-gperf" the above files, if at all? I'm running into the following error when building a gcc cross compiler on linux: gcc -c -DCROSS_COMPILE -DIN_GCC -DHAIFA -DCPU=PPC860 -DHAVE_CONFIG_H -I. -I../../gcc -I../../gcc/config -I../../gcc/../include ../../gcc/c-lex.c In file included from ../../gcc/c-lex.c:170: c-parse.gperf:89: `VEC_STEP' undeclared here (not in a function) c-parse.gperf:89: initializer element is not constant c-parse.gperf:89: (near initialization for `wordlist[132].token') make[1]: *** [c-lex.o] Error 1 make[1]: Leaving directory `/localdisk/data/tornado2.2-cp1-20040816/host/src/gnu.ppc/linux-build/gcc' make: *** [all-gcc] Error 2 At line 170, c-lex.c includes c-gperf.h which was produced by gperf processing the file c-parse.gperf. Any ideas? Iain From ppercot@free.fr Wed Aug 25 20:45:00 2004 From: ppercot@free.fr (Patrick Percot) Date: Wed, 25 Aug 2004 20:45:00 -0000 Subject: Bug ? in hash_map template Message-ID: <20040824.202719.35012417.ppercot@free.fr> Hi, I made some tests with g++ 3.2.3 and g++ 3.3.1 on GNU/Linux and on cygwin g++ 3.3.1. And I got the same results : when I run this program, when inserting "key20" to "key24" the size of the hash_map does not evolve. When I try to get the results back, "key15" to "key19" all give the result 20. I noticed something when debugging the code, in the function resize, the current size is compared to _M_bucket.size() that allways returns 193. Does someone noticed the same behavior ? #include #include using namespace std; using namespace __gnu_cxx; struct eqstr { bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) == 0; } }; int main() { char str[128]; hash_map, eqstr> h; cout << "hash size = " << h.size() << '\n'; for (int i = 0; i < 31; ++i) { sprintf(str, "key%d", i); h[str] = i; cout << "size = " << h.size() << " str = " << str << '\n'; } for (int i = 0; i < 31; ++i) { sprintf(str, "key%d", i); cout << str << " = " << h[str] << '\n'; } } ?+ PP -- Groupe Morbihannais d'Utilisateurs de Logiciels Libres http://www.tuxbihan.org Identifiant Jabber: pp@amessage.de GPG fingerprint = 1A4F E154 3D2C A20E E4CA A543 7951 C5C2 E44A A0B5 Patrick Percot. From j-watson@airvananet.com Wed Aug 25 22:06:00 2004 From: j-watson@airvananet.com (Jon Watson) Date: Wed, 25 Aug 2004 22:06:00 -0000 Subject: Need help to build GCC 3.4.1 for for powerpc-eabi target Message-ID: <41B9D8A6CE9E0A4583291742EECF3CCB03CA5E37@mail.wirelessworld.airvananet.com> Hi - I'm trying to build a GCC 3.4.1 crosscompiler hosted on a Win2K PC (building under Cygwin) with a powerpc-eabi target (need to support PPC750, PPC74xx, MPC82xx, & MPC85xx). When I looked on the GCC 3.4 project web site it didn't appear that anyone else has reported building the powerpc-eabi. I've built the bin-utils (2.14) for powerpc-eabi and they appear to be working. When I build GCC I get an error building genmodes.o. The error from xgcc appears to be that it can't find stdio.h and several other headers that are included by ...\gcc-3.4.1\gcc\system.h. What isn't clear to me is which version of stdio.h *should* be used. I tried editing the makefile to use the headers in /usr/local, but that caused linker errors down the line. I also found a couple of copies of stdio.h in the source tree of the distribution I downloaded from gcc.gnu.org but I can't find one in any of the places the compiler appears to be searching for. Any ideas about what I should do next? Is there a step I'm missing? Below is the output of the make log that I get when build... Thanks in advance, Jon Watson j-watson@airvananet.com $ make bootstrap make[1]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/libiberty' make[2]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/libiberty/testsuite ' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/libiberty/testsuite' make[1]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/libiberty' make[1]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/intl' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/intl' make[1]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/zlib' : make ; exec true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=-O2 -g -O2" "INSTALL=/usr/bin/insta ll -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/insta ll -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCF LAGS_FOR_TARGET=-O2 -g -O2" "MAKE=make" "MAKEINFO=/cygdrive/d/gcc/gcc-3.4.1/miss ing makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin /sh" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/cygdrive/c/ gnutools/gcc-3.4.1" "infodir=/cygdrive/c/gnutools/gcc-3.4.1/info" "libdir=/cygdr ive/c/gnutools/gcc-3.4.1/lib" "prefix=/cygdrive/c/gnutools/gcc-3.4.1" "tooldir=/ cygdrive/c/gnutools/gcc-3.4.1/powerpc-eabi" "AR=ar" "AS=as" "CC=gcc" "CXX=c++" " LD=/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld.ex e" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi -do make[1]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/zlib' Bootstrapping the compiler make[1]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/gcc' make CC=" stage1/xgcc.exe -Bstage1/ -B/cygdrive/c/gnutools/gcc-3.4.1/powerpc-eab i/bin/" CC_FOR_BUILD=" stage1/xgcc.exe -Bstage1/ -B/cygdrive/c/gnutools/gcc-3.4. 1/powerpc-eabi/bin/" \ STAGE_PREFIX=stage1/ \ ADAFLAGS="" CFLAGS="-g -O2" LDFLAGS="" WARN_CFLAGS="\$(GCC_WARN_CFLAGS) " STRICT_WARN="-pedantic -Wno-long-long -Wold-style-definition " libdir=/cygdriv e/c/gnutools/gcc-3.4.1/lib LANGUAGES="c gcov.exe gcov-dump.exe c++ f77 java objc " MAKEINFO="/cygdrive/d/gcc/gcc-3.4.1/missing makeinfo --split-size=5000000" MAK EINFOFLAGS="--no-split" MAKEOVERRIDES= OUTPUT_OPTION="-o \$@" \ CFLAGS="-g -O2" WERROR="" make[2]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/gcc' TARGET_CPU_DEFAULT="" \ HEADERS="auto-host.h ansidecl.h config/i386/xm-cygwin.h" DEFINES="" \ /bin/sh ../../gcc/mkconfig.sh config.h config.h is unchanged TARGET_CPU_DEFAULT="" \ HEADERS="config/rs6000/rs6000.h config/dbxelf.h config/elfos.h config/svr4.h con fig/freebsd-spec.h config/rs6000/sysv4.h config/rs6000/eabi.h defaults.h" DEFINE S="" \ /bin/sh ../../gcc/mkconfig.sh tm.h TARGET_CPU_DEFAULT="" \ HEADERS="auto-host.h ansidecl.h config/i386/xm-cygwin.h" DEFINES="" \ /bin/sh ../../gcc/mkconfig.sh bconfig.h bconfig.h is unchanged stage1/xgcc.exe -Bstage1/ -B/cygdrive/c/gnutools/gcc-3.4.1/powerpc-eabi/bin/ -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wold-style-definition -DHAVE_ CONFIG_H -DGENERATOR_FILE -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../in clude ../../gcc/genmodes.c -o genmodes.o In file included from ../../gcc/genmodes.c:23: ../../gcc/system.h:42:19: stdio.h: No such file or directory ../../gcc/system.h:109:23: sys/types.h: No such file or directory ../../gcc/system.h:111:19: errno.h: No such file or directory ../../gcc/system.h:122:21: string.h: No such file or directory ../../gcc/system.h:123:22: strings.h: No such file or directory ../../gcc/system.h:135:21: stdlib.h: No such file or directory ../../gcc/system.h:158:21: unistd.h: No such file or directory ../../gcc/system.h:162:24: sys/param.h: No such file or directory ../../gcc/system.h:201:23: sys/time.h: No such file or directory ../../gcc/system.h:202:19: time.h: No such file or directory ../../gcc/system.h:214:20: fcntl.h: No such file or directory ../../gcc/system.h:252:22: sys/wait.h: No such file or directory ../../gcc/system.h:319:20: malloc.h: No such file or directory ../../gcc/system.h:383:23: sys/stat.h: No such file or directory ../../gcc/genmodes.c: In function `new_mode': ../../gcc/genmodes.c:159: warning: implicit declaration of function `memcpy' ../../gcc/genmodes.c: In function `eq_mode': ../../gcc/genmodes.c:188: warning: implicit declaration of function `strcmp' ../../gcc/genmodes.c: In function `complete_mode': ../../gcc/genmodes.c:367: warning: implicit declaration of function `abort' ../../gcc/genmodes.c: In function `make_complex_modes': ../../gcc/genmodes.c:419: warning: implicit declaration of function `strlen' ../../gcc/genmodes.c:432: warning: implicit declaration of function `strncpy' ../../gcc/genmodes.c:433: warning: implicit declaration of function `strchr' ../../gcc/genmodes.c:444: warning: implicit declaration of function `snprintf' ../../gcc/genmodes.c: In function `calc_wider_mode': ../../gcc/genmodes.c:736: warning: implicit declaration of function `qsort' ../../gcc/genmodes.c: In function `emit_insn_modes_h': ../../gcc/genmodes.c:771: warning: implicit declaration of function `printf' ../../gcc/genmodes.c:775: warning: implicit declaration of function `puts' ../../gcc/genmodes.c: In function `main': ../../gcc/genmodes.c:1200: error: `free' undeclared (first use in this function) ../../gcc/genmodes.c:1200: error: (Each undeclared identifier is reported only o nce ../../gcc/genmodes.c:1200: error: for each function it appears in.) ../../gcc/genmodes.c:1217: warning: implicit declaration of function `fflush' ../../gcc/genmodes.c:1217: error: `stdout' undeclared (first use in this functio n) ../../gcc/genmodes.c:1217: warning: implicit declaration of function `fclose' make[2]: *** [genmodes.o] Error 1 make[2]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/gcc' make[1]: *** [stage2_build] Error 2 make[1]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/gcc' make: *** [bootstrap] Error 2 From TPCnospam@mklab.ph.rhul.ac.uk Wed Aug 25 23:47:00 2004 From: TPCnospam@mklab.ph.rhul.ac.uk (TPCnospam@mklab.ph.rhul.ac.uk) Date: Wed, 25 Aug 2004 23:47:00 -0000 Subject: subl $, %esp related segfault Message-ID: <200408252045.i7PKjcEG025776@mklab.ph.rhul.ac.uk> Dear All, I am getting segfaults in a FORTRAN program compiled with g95 under Linux/i386 but the problem is not specific to g95. I can simulate it with g77 which similarly uses gcc's assembler generation routines. It is just that I have some quite large subroutines (originally Fortran 77) which been trivially converted to use a derived datatype under g95 which has the effect of substantially increasing the code size and memory usage -- to the extent that the problem I'm describing occurs. The problem subroutines are part of a set of similar, numerically intensive ones, most of which work fine. It is just the few biggest ones which have this problem. Here is some assembler O/P from g95 for a problem subroutine. .type fo7dma0dmc0_, @function fo7dma0dmc0_: .LFB93: .loc 1 1 0 pushl %ebp .LCFI315: movl %esp, %ebp .LCFI316: pushl %edi .LCFI317: pushl %esi .LCFI318: pushl %ebx .LCFI319: subl $9389456, %esp .LCFI320: .loc 2 20 0 .LBB47: pushl $3 pushl $.LC0 etc. etc. Here is my analysis: The 'subl $9389456, %esp' pulls the stack pointer down by that large number. When the 'pushl $3' tries to execute it overflows the stack and gets a segfault. My FORTRAN code uses static allocation. The thing I don't understand is; what precisely is the subl's purpose? Is there a way to reduce its size? eg. a compiler option. I'm reluctant to try splitting the subroutine up into two smaller ones. Any other ideas? Thanks Tom. Ps. Where can I find a description of GNU/Linux procedure calling standard? -- Tom Crane, Dept. Physics, Royal Holloway, University of London, Egham Hill, Egham, Surrey, TW20 0EX, England. Email: T.Crane@rhul.ac.uk Fax: +44 (0) 1784 472794 From netbsd@wolfnode.de Thu Aug 26 06:46:00 2004 From: netbsd@wolfnode.de (Florian Stoehr) Date: Thu, 26 Aug 2004 06:46:00 -0000 Subject: CPP preprocessor: #define-splitting? Message-ID: Hi, I'm developing a gcc-compatible preprocessor for a compiler project. While doing this, I discovered something strange. In preprocessor documentation: /\ * */ # /* */ defi\ ne FO\ O 10\ 20 will expand to "#define FOO 1020". It does. But: # /* */ define TEST "foo" --> #define TEST "foo" Replacing the "#" by an "X" will produce with gcc -E: X define TEST "foo" _BUT_: # define TEST "foo" --> TEST doen't get defined. The problem is: Why does it recognize the "#" and "define" splitted by a multi-line comment as "#define"? Is this the correct behaviour? Thanks for your help Florian From eljay@adobe.com Thu Aug 26 07:13:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 26 Aug 2004 07:13:00 -0000 Subject: CPP preprocessor: #define-splitting? In-Reply-To: References: Message-ID: <6.1.2.0.2.20040825184620.01e4f9d8@iplan-mn.corp.adobe.com> Hi Florian, The # is a preprocessor directive. The X is not a preprocessor directive. The rules for parsing preprocessor directives is different form the rules for parsing non-preprocessor directives. (The state machine is in a different state.) HTH, --Eljay From arno.wilhelm@profile.co.at Thu Aug 26 07:28:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Thu, 26 Aug 2004 07:28:00 -0000 Subject: subl $, %esp related segfault In-Reply-To: <200408252045.i7PKjcEG025776@mklab.ph.rhul.ac.uk> References: <200408252045.i7PKjcEG025776@mklab.ph.rhul.ac.uk> Message-ID: <1093502786.12104.2.camel@dione.profile.co.at> > Ps. Where can I find a description of GNU/Linux procedure calling > standard? Here is a lot of documentation: http://linuxassembly.org/resources.html#docs http://linuxassembly.org/intro/hello.html#AEN55 Arno From achordia@ptc.com Thu Aug 26 09:54:00 2004 From: achordia@ptc.com (Amit Chordia) Date: Thu, 26 Aug 2004 09:54:00 -0000 Subject: [Fwd: GCC Specific warning to error] Message-ID: <412D8D57.7020204@ptc.com> -------------- next part -------------- An embedded message was scrubbed... From: Amit Chordia Subject: GCC Specific warning to error Date: Thu, 26 Aug 2004 12:31:06 +0530 Size: 617 URL: From netbsd@wolfnode.de Thu Aug 26 12:10:00 2004 From: netbsd@wolfnode.de (Florian Stoehr) Date: Thu, 26 Aug 2004 12:10:00 -0000 Subject: CPP preprocessor: #define-splitting? In-Reply-To: <6.1.2.0.2.20040825184620.01e4f9d8@iplan-mn.corp.adobe.com> References: <6.1.2.0.2.20040825184620.01e4f9d8@iplan-mn.corp.adobe.com> Message-ID: On Wed, 25 Aug 2004, Eljay Love-Jensen wrote: > Hi Florian, > > The # is a preprocessor directive. > > The X is not a preprocessor directive. > > The rules for parsing preprocessor directives is different form the rules > for parsing non-preprocessor directives. (The state machine is in a > different state.) > > HTH, > --Eljay > > Hi, thanks for the reply. But there seems to happen something strange BEFORE the preprocessing itself (in comment remove stage?). Why am I allowed to do a... # /* */ define and a # define not? I thought the stage where it strips out comments comes before the "main" preprocessor where it scans for #-directives. so why is the # define allowed to be split on multiple lines WITHOUT a backslash-newline? afaik, any comment gets replaced by a single " " and every newline inside the comment gets added AFTER the comment. so the # /* */ define should become a # define after the comment removing stage - but this does not work see above. (just confused wheter it does something special with comments "inside" a #-directive) -Florian From vonloesch@gmail.com Thu Aug 26 14:16:00 2004 From: vonloesch@gmail.com (Boris von Loesch) Date: Thu, 26 Aug 2004 14:16:00 -0000 Subject: Problem with implicit conversion (GCC 3.4.1) Message-ID: <41a2e2dc04082602547057f04c@mail.gmail.com> Hello, I have written a program that compiles just fine with GCC 3.3. With GCC 3.4.1 it results in this error: g++ -O0 -g3 -Wall -c -oTestp.o ../Testp.c ../Testp.c: In function `int main()': ../Testp.c:26: error: no match for 'operator<=' in 't <= 2.0e+0' Please help me, I have no idea where the problem is. Here is the code: template class BasisF; template inline bool operator<=(const BasisF &a, const BasisF &b){return a.x <= b.x;} template class BasisF{ public: T x; BasisF(const T &_x = T()): x(_x){} BasisF(const BasisF &_b): x(_b.x){} ~BasisF(){} BasisF& operator= (const T &_x){ x(_x); return *this; } friend bool operator<=<>(const BasisF &a, const BasisF &b); }; #define min(a,b) ((a) <= (b) ? (a) : (b)) int main(){ BasisF t(1); if (min(t,2.0)<=0) return 1; return 0; } Regards, Boris From suresh@comodogroup.com Thu Aug 26 14:22:00 2004 From: suresh@comodogroup.com (L.Suresh) Date: Thu, 26 Aug 2004 14:22:00 -0000 Subject: std::string, std::ostringstream behaves unpredictably in multithreaded environment. Message-ID: <1093522170.5336.22.camel@Ironwing> Hi, I'm using pthreads on Fedora Core 1. I have compiled my entire project with -D_REENTRANT -D_MULTI_THREADED I get Segmentation faults for naive code that uses std::string's operator+, std::ostringstream's operator<< as a local variable in stack. std::string Formatter::format(const LogRecord& record) const { std::ostringstream ost; ost << record.getTime() << " " << record.getMessage(); //<--Crashes return ost.str(); } Do i have to do anything extra in order for my program to behave predictably in multi-threaded environment? Regards, L.Suresh. From eljay@adobe.com Thu Aug 26 15:23:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 26 Aug 2004 15:23:00 -0000 Subject: searching the GCC manual (tip of the day) Message-ID: <6.1.2.0.2.20040826091117.01e4f4d8@iplan-mn.corp.adobe.com> Tip of they day.. Put this into a script where you've unpacked your GCC documentation from the tarball. --------------------------- echo "" >tmp.htm echo "

Your results..." >>tmp.htm grep -l -i "$1" *.html | sed 's@\(.*\)@
\1@' >> tmp.htm echo "" >tmp.htm --------------------------- This will create a (more-or-less well-formed) html page with your search results. Since the GCC documentation pages end in extension ".html", this page should be isolated from the real documentation. Then you can use your browser to load up tmp.htm and view each of the resulting pages. Enjoy, --Eljay From eljay@adobe.com Thu Aug 26 15:56:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 26 Aug 2004 15:56:00 -0000 Subject: searching the GCC manual (tip of the day) In-Reply-To: <6.1.2.0.2.20040826091117.01e4f4d8@iplan-mn.corp.adobe.com> References: <6.1.2.0.2.20040826091117.01e4f4d8@iplan-mn.corp.adobe.com> Message-ID: <6.1.2.0.2.20040826092105.01e6c8e0@iplan-mn.corp.adobe.com> Cut and paste error missed a ">" where a ">>" was needed, fixed below... --------------------------- echo "" >tmp.htm echo "

Your results..." >>tmp.htm grep -l -i "$1" *.html | sed 's@\(.*\)@
\1@' >> tmp.htm echo "" >>tmp.htm --------------------------- --Eljay From purnendu@gmail.com Thu Aug 26 15:59:00 2004 From: purnendu@gmail.com (Purnendu/Gmail) Date: Thu, 26 Aug 2004 15:59:00 -0000 Subject: allignment in structures Message-ID: <4ca029ac04082608234d62cfda@mail.gmail.com> #pragma pack(2) struct abc { char a; char b; char c; }; A sizeof( struct abc) gives 3, shouldnot i expect it to be 4? any pointers??? i am using " gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)" -purnendu From steve@millersnet.net Thu Aug 26 16:05:00 2004 From: steve@millersnet.net (steve@millersnet.net) Date: Thu, 26 Aug 2004 16:05:00 -0000 Subject: how to combine gcc and binutils source into one tree Message-ID: <1803.192.168.0.4.1093535979.squirrel@nautilus.tsunami.us> they have common directories libiberty,include,texinfo,config, etc.... what is the best way to merge them? thanks in advance Steven From eljay@adobe.com Thu Aug 26 16:19:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 26 Aug 2004 16:19:00 -0000 Subject: allignment in structures In-Reply-To: <4ca029ac04082608234d62cfda@mail.gmail.com> References: <4ca029ac04082608234d62cfda@mail.gmail.com> Message-ID: <6.1.2.0.2.20040826105923.01fbd390@iplan-mn.corp.adobe.com> Hi Purnendu, >A sizeof( struct abc) gives 3, shouldnot i expect it to be 4? No, it should be 3 in this case. The char data type has an alignment of 1. #pragma pack(2) does not increase alignment requirements, it only decreases them. >any pointers??? Use GCC __attribute__ with aligned and pack to affect alignment and/or packing, don't use #pragma pack. // C++ example. #include #include struct Foo { char a __attribute__((aligned(2))); char b __attribute__((aligned(2))); long c __attribute__((packed)); char d; char e; }; int main() { printf("Foo.a %d\n", offsetof(Foo, a)); printf("Foo.b %d\n", offsetof(Foo, b)); printf("Foo.c %d\n", offsetof(Foo, c)); printf("Foo.d %d\n", offsetof(Foo, d)); printf("Foo.e %d\n", offsetof(Foo, e)); } Note: the aligned attribute has certain restrictions, depending on platform. See the online documentation. Often, alignment and packing are used to mimic a canonical data structure, which populates the structure using read or fread. I strongly discourage that practice, and encourage having a helper read routine that populates the structure field-by-field from the byte-by-byte data source. Likewise, the inverse for the write routines. HTH, --Eljay From manoj_mp@hotmail.com Thu Aug 26 16:27:00 2004 From: manoj_mp@hotmail.com (Manoj Pillai) Date: Thu, 26 Aug 2004 16:27:00 -0000 Subject: GCC Project Help ! Message-ID: Hello Sir , I am Manoj Pillai , i am doing my Computer Engg. as a part of Final Year Project we hv been given a topic "Reverse Enggineering OF GCC Front End " And the as a inital part of The project , we hv been asked to analysis , a file called expr.c which converts the parse tree to RTL . It wouild be my pleasure , if u let me know abt how to go about it. And is there any site which could let em know abt the Data structure used in GCC . It would be also nice, if u could let me know any GCC contributor would be interested in Helping us or any other forum where we could het assist from . Thanks. Yours Truly Manoj Pillai . Have a Nice Day . _________________________________________________________________ Marriage by choice.... http://www.shaadi.com/ptnr.php?ptnr=hmltag Log onto Shaadi.com. From dk@artimi.com Thu Aug 26 17:27:00 2004 From: dk@artimi.com (Dave Korn) Date: Thu, 26 Aug 2004 17:27:00 -0000 Subject: GCC Project Help ! In-Reply-To: Message-ID: > -----Original Message----- > From: gcc-owner On Behalf Of Manoj Pillai > Sent: 26 August 2004 17:05 > To: gcc-help; gcc > Subject: GCC Project Help ! > > > Hello Sir , > > I am Manoj Pillai , i am doing my Computer Engg. as a part > of Final Year > Project we hv been given a topic > > "Reverse Enggineering OF GCC Front End " Hey, that sounds fairly easy, given that the source code is publicly available! > And the as a inital part of The project , we hv been asked to > analysis , a > file called expr.c which converts the parse tree to RTL . > > It wouild be my pleasure , if u let me know abt how to go > about it. How to analyse a source file? Isn't that what the course you've been doing was supposed to teach you? Are you asking us to summarize all the lessons and lectures that you have been taught during your course? Or just to do your homework for you? > And is > there any site which could let em know abt the Data structure > used in GCC . You want to see the compiler internals documentation: http://gcc.gnu.org/onlinedocs/gccint/ That's the best explanation you'll get of the overall structure and operations of the compiler. The rest you have to understand by studying the source code and seeing how it works, what functions there are, looking at RTL dumps, running gcc under a debugger to see where the control flow goes and what it does when it's there, etc. etc. There are a lot of comments in the source code; they're not all entirely up-to-date or accurate, but most of the data structures in the source code have good comments to explain what they are for and what all the data members mean. > It would be also nice, if u could let me know any GCC > contributor would be > interested in Helping us or any other forum where we could > het assist from . You're on a university course. If you need some training in software engineering techniques, why not ask your tutors? They are supposed to be there to help you..... cheers, DaveK -- Can't think of a witty .sigline today.... From lrtaylor@micron.com Thu Aug 26 17:46:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Thu, 26 Aug 2004 17:46:00 -0000 Subject: Problem with implicit conversion (GCC 3.4.1) Message-ID: <363801FFD7B74240A329CEC3F7FE4CC403096133@ntxboimbx07.micron.com> Well, you've declared a <= operator that can compare to BasisF objects, but you're trying to compare a BasisF object with a double, which you haven't created an operator for: min(t,2.0) -> ((t) <= (2.0) ? (t) > (2.0)) So, in your min macro, you are trying to compare the object t with the double 2.0. You don't have an operator for that. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Boris von Loesch Sent: Thursday, August 26, 2004 3:55 AM To: gcc-help@gcc.gnu.org Subject: Problem with implicit conversion (GCC 3.4.1) Hello, I have written a program that compiles just fine with GCC 3.3. With GCC 3.4.1 it results in this error: g++ -O0 -g3 -Wall -c -oTestp.o ../Testp.c ../Testp.c: In function `int main()': ../Testp.c:26: error: no match for 'operator<=' in 't <= 2.0e+0' Please help me, I have no idea where the problem is. Here is the code: template class BasisF; template inline bool operator<=(const BasisF &a, const BasisF &b){return a.x <= b.x;} template class BasisF{ public: T x; BasisF(const T &_x = T()): x(_x){} BasisF(const BasisF &_b): x(_b.x){} ~BasisF(){} BasisF& operator= (const T &_x){ x(_x); return *this; } friend bool operator<=<>(const BasisF &a, const BasisF &b); }; #define min(a,b) ((a) <= (b) ? (a) : (b)) int main(){ BasisF t(1); if (min(t,2.0)<=0) return 1; return 0; } Regards, Boris From suresh_lakshmana@hotmail.com Thu Aug 26 19:54:00 2004 From: suresh_lakshmana@hotmail.com (Suresh Lakshmanan) Date: Thu, 26 Aug 2004 19:54:00 -0000 Subject: Problem with implicit conversion (GCC 3.4.1) Message-ID: Try the code below. You could use std::min template in STL, so that you can force conversion to the template parameter. template class BasisF { T x; public: BasisF(const T &_x = T()): x(_x) {} BasisF(const BasisF &_b): x(_b.x) {} ~BasisF() {} BasisF& operator= (const T &_x){ x(_x); return *this; } friend bool operator<=(const BasisF &a, const BasisF &b) { return a.x <= b.x; } }; #define min(a,b) ((a) <= (b) ? (a) : (b)) int main(){ BasisF t(1); if (min(t, 2.0)<= 0) { return 1; } return 0; } Thanks, L.Suresh. _________________________________________________________________ Sell what you don??t Need.We help you Ship it out. http://go.msnserver.com/IN/54179.asp Click Here! From lars.segerlund@comsys.se Thu Aug 26 21:34:00 2004 From: lars.segerlund@comsys.se (Lars Segerlund) Date: Thu, 26 Aug 2004 21:34:00 -0000 Subject: GCC Project Help ! In-Reply-To: References: Message-ID: <20040826194612.14d7fa8b@zeta.comsys.se> It's easy. You first download gcc from cvs and build. Then you get the gcc summit procedings for the last five years or so. Now you only have to look into the code. So three simple steps and you're there. / good luck, Lars Segerlund. On Thu, 26 Aug 2004 16:05:16 +0000 "Manoj Pillai" wrote: > > Hello Sir , > > I am Manoj Pillai , i am doing my Computer Engg. as a part of Final Year > Project we hv been given a topic > > "Reverse Enggineering OF GCC Front End " > > And the as a inital part of The project , we hv been asked to analysis , a > file called expr.c which converts the parse tree to RTL . > > It wouild be my pleasure , if u let me know abt how to go about it. And is > there any site which could let em know abt the Data structure used in GCC . > > It would be also nice, if u could let me know any GCC contributor would be > interested in Helping us or any other forum where we could het assist from . > > Thanks. > > Yours Truly > > Manoj Pillai . > > Have a Nice Day . > > _________________________________________________________________ > Marriage by choice.... http://www.shaadi.com/ptnr.php?ptnr=hmltag Log onto > Shaadi.com. > From vonloesch@gmail.com Thu Aug 26 22:17:00 2004 From: vonloesch@gmail.com (Boris von Loesch) Date: Thu, 26 Aug 2004 22:17:00 -0000 Subject: Problem with implicit conversion (GCC 3.4.1) In-Reply-To: References: Message-ID: <41a2e2dc04082612547497f4c8@mail.gmail.com> Thanks for your replay. This code works, but why does your code work and my not? Why does it not compile with gcc 3.4.1 but with gcc 3.3? Boris On Thu, 26 Aug 2004 17:27:36 +0000, Suresh Lakshmanan wrote: > Try the code below. You could use std::min template in STL, so that you can > force conversion > to the template parameter. > > template class BasisF { > T x; > public: > > BasisF(const T &_x = T()): x(_x) {} > BasisF(const BasisF &_b): x(_b.x) {} > ~BasisF() {} > > BasisF& operator= (const T &_x){ > x(_x); > return *this; > } > > friend bool operator<=(const BasisF &a, const BasisF &b) { > return a.x <= b.x; > } > }; > > #define min(a,b) ((a) <= (b) ? (a) : (b)) > > int main(){ > BasisF t(1); > if (min(t, 2.0)<= 0) { > return 1; > } > > return 0; > } From pauasc@earthlink.net Fri Aug 27 05:18:00 2004 From: pauasc@earthlink.net (Paul Arbour) Date: Fri, 27 Aug 2004 05:18:00 -0000 Subject: WANTED OKUMA LU-15 Message-ID: <091701c48b8f$90e88c00$6401a8c0@office> WANTED: Okuma LU 15 CNC LATHE -- will pay cash, actually -- interested in all Okumas--please email sales@westecmachinery.com Best Regards, BarbaraMark sales@westecmachinery.com From Mark.Zvilius@fluke.com Fri Aug 27 06:58:00 2004 From: Mark.Zvilius@fluke.com (Zvilius, Mark) Date: Fri, 27 Aug 2004 06:58:00 -0000 Subject: asm constraints Message-ID: <732BE51FE9901143AE04411A11CC46560484AAB5@evtexc02.tc.fluke.com> For a PowerPC architecture I'm using the following asm statement in C source to read a time base register: unsigned int tbl; __asm__("mftbl %0" : "=r" (tbl)); The code this generates is: mftb r0 mr r9,r0 stw r9,0x18(r31) I'm wondering why it's wasting a register. Am I specifying the constraint incorrectly? Mark Z. From zack@codesourcery.com Fri Aug 27 07:08:00 2004 From: zack@codesourcery.com (Zack Weinberg) Date: Fri, 27 Aug 2004 07:08:00 -0000 Subject: compiles under g++ but not gcc In-Reply-To: <1093582054.1431.7.camel@darkstar.org> (sol@avalon.pascal-central.com's message of "Fri, 27 Aug 2004 00:47:34 -0400") References: <1093582054.1431.7.camel@darkstar.org> Message-ID: <87n00h9n0h.fsf@codesourcery.com> sol writes: > Hello, not sure I'm posting this to the right list, but I couldn't seem > to find any others. This question is appropriate for gcc-help@gcc.gnu.org, or for a general learning-to-program group, but not for gcc@gcc.gnu.org. gcc@gcc.gnu.org is for discussion of development _of_, not _with_, gcc. I will answer this question anyway, but please do not post further such questions. > I've noticed a problem compiling under g++ and gcc. a program I am > working on compiles fine under g++, but gives a number of errors > with gcc. I have defined a simple structure in a header file, > included this header in the main file that uses this structure, and > when I compile under gcc, I get errors related to all variables of > that structure type (the one defined in the header); it does not > recognize the structure type that was defined in the header. When > compiling under g++, there is no problem at all. Since you did not show us any code, I can only guess what your problem is. You have probably run afoul of a well-known difference between C and C++. In C++, if you write struct S { int whatever; }; you may then write S variable; In C by contrast you must write struct S variable; unless you use a typedef to define 'S' as equivalent to 'struct S'. zw From learning_c@hotmail.com Fri Aug 27 09:16:00 2004 From: learning_c@hotmail.com (learning c++) Date: Fri, 27 Aug 2004 09:16:00 -0000 Subject: template-id does not match any template declaration Message-ID: Hi, I am a novice for C++, and I compiled a program with C++ and there are an error, Pleaes help me. Thanks, #include template class pair { T value1, value2; public: pair (T first, T second) {value1=first; value2=second;} T module () {return 0;} }; template <> class pair { int value1, value2; public: pair (int first, int second) {value1=first; value2=second;} int module (); }; template <> int pair::module() { return value1%value2; } int main () { pair myints (100,75); pair myfloats (100.0,75.0); std::cout << myints.module() << '\n'; std::cout << myfloats.module() << '\n'; return 0; } Error: templatemodule1.cpp:22: error: template-id `module<>' for `int pair::module()' does not match any template declaration templatemodule1.cpp:22: error: syntax error before `{' token _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From Daniel_Yu@Jabil.com Fri Aug 27 11:13:00 2004 From: Daniel_Yu@Jabil.com (Daniel Yu) Date: Fri, 27 Aug 2004 11:13:00 -0000 Subject: The question for compiling gcc-3.4.1 for xscale target Message-ID: <2A5969FA1F2BAE48BA505A2BD83BD9650217C062@shamsg10.corp.jabil.org> Hello everyone: I want to compile the gcc-3.4.1 for xscale-target linux. My OS is redhat 9.0, gcc is 3.2.2. After i download the package from gcc.gnu.org, I made the following configure: configure --target=xscale-elf --prefix=/usr/local/arm/3.4.1 --program-prefix=xscale-elf- --with-local-prefix=/usr/local/arm/3.4.1/ --with-as=/usr/local/arm/3.4.1/bin --with-ld=/usr/local/arm/3.4.1/bin I don't know wether the configure is right. During the MAKE process, an error occurs: "configure: error: No support for this host/target combination." I think that there must be some problems when i configure the make parameters. Is there anyone compiled the gcc for arm target successfully. Please give a hand. It is better for giving a configure sample to me. Thanks a lot! Daniel From segher@kernel.crashing.org Fri Aug 27 11:16:00 2004 From: segher@kernel.crashing.org (Segher Boessenkool) Date: Fri, 27 Aug 2004 11:16:00 -0000 Subject: asm constraints In-Reply-To: <732BE51FE9901143AE04411A11CC46560484AAB5@evtexc02.tc.fluke.com> References: <732BE51FE9901143AE04411A11CC46560484AAB5@evtexc02.tc.fluke.com> Message-ID: > unsigned int tbl; > __asm__("mftbl %0" : "=r" (tbl)); [side note: mftbl is not a PowerPC insn, nor an assembler extended mnemonic. I have no idea why libopcodes accepts it]. > I'm wondering why it's wasting a register. Did you compile with optimization on? If so, what compiler version did you use? I tried with 3.4.1 and it works just fine. If you still have problems, please show the exact code (full routine, compilable as-is). > Am I specifying the constraint incorrectly? No, it's fine. Segher From sdodsley@hotmail.com Fri Aug 27 11:52:00 2004 From: sdodsley@hotmail.com (Simon Dodsley) Date: Fri, 27 Aug 2004 11:52:00 -0000 Subject: Problem with g++ on Tru64 5.1B (gcc 3.4.1) Message-ID: Hi I am new to compiling gcc, so please bear with me if I am just being stupid. Have built 3.4.1 on a alphaev68-osf-5.1 system. gcc seems to be fine, but g++ is failing continuously. It can't find any include files and the libstdc++ libraries don't seem to exist anywhere. I specified c++ in the enable-languages switch. Anyone else seen this? Have I missed a simple step, or this this a real problem? Regards, Simon From arno.wilhelm@profile.co.at Fri Aug 27 12:11:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Fri, 27 Aug 2004 12:11:00 -0000 Subject: template-id does not match any template declaration In-Reply-To: References: Message-ID: <1093605413.24261.1.camel@dione.profile.co.at> > I am a novice for C++, and I compiled a program with C++ and there are an > error, Pleaes help me. Try this: 1 #include 2 3 4 template 5 class pair 6 { 7 public: 8 pair(T first, T second) {value1=first; value2=second;} 9 T module () {return 0;} 10 11 private: 12 T value1; 13 T value2; 14 }; 16 17 template <> 18 class pair 19 { 20 public: 21 pair (int first, int second) {value1=first; value2=second;} 22 int module ( ) { return (value1 % value2); } 23 private: 24 int value1; 25 int value2; 26 }; 35 36 int main (void) 37 { 38 pair myints (100, 75); 39 pair myfloats (100.0, 75.0); 40 41 std::cout << myints.module() << '\n'; 42 std::cout << myfloats.module() << '\n'; 43 44 return 0; 45 } 46 Arno > Thanks, > > #include > > template > class pair { > T value1, value2; > public: > pair (T first, T second) > {value1=first; value2=second;} > T module () {return 0;} > }; > > template <> > class pair { > int value1, value2; > public: > pair (int first, int second) > {value1=first; value2=second;} > int module (); > }; > > template <> > int pair::module() { > return value1%value2; > } > int main () { > pair myints (100,75); > pair myfloats (100.0,75.0); > std::cout << myints.module() << '\n'; > std::cout << myfloats.module() << '\n'; > return 0; > } > > Error: > templatemodule1.cpp:22: error: template-id `module<>' for `int > pair::module()' does not match any template declaration > templatemodule1.cpp:22: error: syntax error before `{' token > > _________________________________________________________________ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail -- Arno Wilhelm proFILE Computersysteme GmbH From artur@alice.phy.uct.ac.za Fri Aug 27 12:18:00 2004 From: artur@alice.phy.uct.ac.za (Artur Szostak) Date: Fri, 27 Aug 2004 12:18:00 -0000 Subject: using keyword problem Message-ID: <200408271352.03444.artur@alice.phy.uct.ac.za> Why does the following code not compile under GCC? Is this not valid C++? class A { public: struct S { int x; }; }; int Method() { using A::S; S s; s.x = 1; return s.x; }; When compiling the above code as is from source file main.cxx the following output is generated: $ g++ main.cxx -o test main.cxx: In function `int Method()': main.cxx:12: parse error before `::' token main.cxx:14: `S' undeclared (first use this function) main.cxx:14: (Each undeclared identifier is reported only once for each function it appears in.) main.cxx:15: `s' undeclared (first use this function) $ -- Artur Szostak Physics Department University of Cape Town Rondebosch 7701 South Africa Work: +27 21 650 3356 Mobile: +27 82 297 9502 Email: artur@alice.phy.uct.ac.za or artursz@iafrica.com From suresh@comodogroup.com Fri Aug 27 12:27:00 2004 From: suresh@comodogroup.com (L.Suresh) Date: Fri, 27 Aug 2004 12:27:00 -0000 Subject: using keyword problem Message-ID: <1093608668.5336.103.camel@Ironwing> The using-declaration is used to bring every declaration with a given name into scope. Here when you say A::S, there is no namespace "A", it is the name of the class. Try the code below. class A { public: struct S { int x; }; }; int Method() { A::S s; s.x = 1; return s.x; }; Thanks, L.Suresh From eljay@adobe.com Fri Aug 27 15:03:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 27 Aug 2004 15:03:00 -0000 Subject: using keyword problem In-Reply-To: <200408271352.03444.artur@alice.phy.uct.ac.za> References: <200408271352.03444.artur@alice.phy.uct.ac.za> Message-ID: <6.1.2.0.2.20040827071730.01f2c210@iplan-mn.corp.adobe.com> Hi Artur, The "using" keyword is for bring identifiers from one namespace available in the current namespace. For example: using std::cout; // cout is now accessible, without the std:: qualifier. using namespace std: // the whole std:: uberverse is accessible. Avoid collisions! A class and a struct or sort of like namespaces, and also not like namespaces. You want to do this... class A { public: struct S { int x; }; }; int Method() { typedef A::S S; // using A::S is no good here. S s; s.x = 1; return s.x; }; HTH, --Eljay From eljay@adobe.com Fri Aug 27 15:04:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 27 Aug 2004 15:04:00 -0000 Subject: template-id does not match any template declaration In-Reply-To: References: Message-ID: <6.1.2.0.2.20040827072207.01e4ae88@iplan-mn.corp.adobe.com> Hi, You were almost there! Just a little syntax tweak for your separate definition of your member function of your explicit template specialization for pair::module. (See below.) Also, I changed the return statement on your general pair template pair::module to something more suitable. Caution, there is a std::pair. Your ::pair is okay, but could be a little better protected by putting your pair class in your own namespace. Or, make sure you never do a "using namespace std" anywhere (I disparage "pulling in the std uberverse namespace" on general principle). HTH, --Eljay ------------------------------- #include using std::cout; template class pair { T value1; T value2; public: pair(T first, T second) { value1 = first; value2 = second; } T module() { return T(); } }; template <> class pair { int value1; int value2; public: pair(int first, int second) { value1 = first; value2 = second; } int module(); }; int pair::module() { return value1 % value2; } int main() { pair myints(100, 75); pair myfloats(100.0, 75.0); cout << myints.module() << '\n'; cout << myfloats.module() << '\n'; } From Nils.Dehn@t-online.de Fri Aug 27 15:14:00 2004 From: Nils.Dehn@t-online.de (Nils.Dehn@t-online.de) Date: Fri, 27 Aug 2004 15:14:00 -0000 Subject: Linker library search path Message-ID: <1C0iGW-0GM8My0@filter04.bbul.t-online.de> SuSE Linux 2.4.21-215-smp gcc-3.4.0 My machines comes with a kerberos pre-installed ( /usr/lib/libkrb5.so.17 ). I have a self compiled kerberos at /db/opt/krb5-1.3.4/lib/libkrb5.so.3.2). I'd like to compile an apache module shared library against my kerberos libkrb5.so.3.2 version. Using linker options -L /db/opt/krb5-1.3.4/lib/libkrb5.so.3.2 -l krb5 and libkrb5.so.3.2 being in LD_LIBRARY_PATH I still find (using ldd) that my module is linked against BOTH libkrb5.so.17 AND libkrb5.so.3.2 Obviously the linker first tries to resolve the symbols using it's default path /usr/lib and then looks for the remaining symbols in the -L path. How can I get the linker from looking is /usr/lib first ? For security reasons: I cannot alter the contents of /usr/lib. I cannot refresh the library cache using ldconfig. Thank you in advance Nils From david@thekramers.net Fri Aug 27 15:16:00 2004 From: david@thekramers.net (David Kramer) Date: Fri, 27 Aug 2004 15:16:00 -0000 Subject: AIX architecture problems Message-ID: Background: AIX 5.2 box. My mission is to port my company's application from AIX's native xlC compiler to the GNU toolchain. I bootstraped gcc 3.4.0 from a gcc 3.3.3 (build for AIX5.1) I downloaded. I built gcc with an architecture of "powerpc-ibm-aix5.2.0.0". I'm still using a binutils built by someone else. I can tell you this: /opt/local/bin/ld: supported targets: aixcoff-rs6000 aix5coff64-rs6000 srec symbolsrec tekhex binary ihex /opt/local/bin/ld: supported emulations: aix5ppc /opt/local/bin/ld: emulation specific options: no emulation specific options. /opt/local/bin/ld -v GNU ld version 2.14 20030612 > lsattr -E -l proc0 (there are 4 identical processors) frequency 339999568 Processor Speed False state enable Processor state False type PowerPC_RS64-II Processor type False I've got all the code compiled using g++ to .o files after some pretty significant changes, but linking produces output I don't understand. Here's a shortened version of the output: g++ -I. -I../common -I/dkramer/build/dhgcc340/trunk/rogue -I/dkramer/build/dhgcc340/trunk/rogue -I/dkramer/build/dh gcc340/trunk/dbaccess -g -DDEBUG -D_DEBUG -DRWDEBUG -DUSE_SYB -DSHOWSQL -Daix -DRS6000 -Daix_ansi -D_RWCONFIG=xsd -DRWTLS7 -DRWDB5 -L/software/sybase/sybase125/OCS-12_5/lib -L/dkramer/build/dhgcc340/trunk/lib -DUSE_FS -D DISABLE_SHLIB_ACCESS=1 -DRW_NO_LEADING_UNDERSCORE -DRWDB_SYB_DBLIB -Wno-deprecated -o gensql gensql.o rpttype.o /dkramer/build/dhgcc340/trunk/lib/rwctlxsd.o -ltcdbd -lrfac0d -lctl52-xsd -ldbt52-xsd -ltccommond -ltls77- xsd -ltcl -lct -lcs -lblk -lnsl -lcomn -lintl -ldl -lm /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/lib/libm.a(log10.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/lib/libm.a(tan.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/lib/libm.a(round.o)' is incompatible with rs6000:6000 output ... /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_divdi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_moddi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_udivdi3.o)' is incompatible with rs6000:6000 output An off-list post directed me towards the -m options and the -mcpu= option. Which combination of -mfoo and -mcpu=foo do I need, based on the lsattr output above, and the "is incompatible with rs6000:6000 output" message? -Do I need to just specify one or more of those command line option I'm missing? -Do I need to rebuild the compiler itself with this option? I'm guessing I do, since it's complaining about its own libraries that got built with it -Do I need to rebuild the compiler itself with this option? I'm guessing I do, since it's complaining about its own libraries that got built with it. Thanks in advance. Apologies in advance if this is something stupid; this is the first time I've done something like this. I did STFW, but most of the references I found were problems with 32/64 bit incompatibilities, which I don't think is the problem here. From eljay@adobe.com Fri Aug 27 16:17:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 27 Aug 2004 16:17:00 -0000 Subject: Linker library search path In-Reply-To: <1C0iGW-0GM8My0@filter04.bbul.t-online.de> References: <1C0iGW-0GM8My0@filter04.bbul.t-online.de> Message-ID: <6.1.2.0.2.20040827101155.01f2e090@iplan-mn.corp.adobe.com> Hi Nils, One way is to specify the fully qualified file name to your own krb5... gcc -o myapp myapp.cpp /db/opt/krb5-1.3.4/lib/libkrb5.so.3.2/libkrb5.so.3.2 ...and don't use the -L and -l parameters. HTH, --Eljay From eljay@adobe.com Fri Aug 27 21:24:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 27 Aug 2004 21:24:00 -0000 Subject: [Fwd: GCC Specific warning to error] In-Reply-To: <412D8D57.7020204@ptc.com> References: <412D8D57.7020204@ptc.com> Message-ID: <6.1.2.0.2.20040827101514.01e3b678@iplan-mn.corp.adobe.com> Hi Amit, >Is there any way where I can tell the compiler to make a particular warning to represent as error like we do it in 'cl' with the use of 'pragma' ? You can turn off all warnings, then turn on the warnings you are interested in, and then turn all warnings-into-errors. All on the command line invocation of gcc (or g++) as the compiler/linker. That's about as close as you can get, though. HTH, --Eljay From thl@dev.de.cw.com Sat Aug 28 09:06:00 2004 From: thl@dev.de.cw.com (Thomas Lotterer) Date: Sat, 28 Aug 2004 09:06:00 -0000 Subject: Problem with g++ on Tru64 5.1B (gcc 3.4.1) In-Reply-To: References: Message-ID: <20040827161727.GF86691@dev.de.cw.com> Maybe OpenPKG can help you. It is a cross platform packaging solution and all CORE packages are known to work on Tru64 5.1. Have a look http://www.openpkg.org and give it a try. OpenPKG focuses on sources which implies a chicken-egg problem but you can find unofficial binaries at http://www.zfos.org/openpkg.html -- Thomas.Lotterer@cw.com, Cable & Wireless From david@thekramers.net Sat Aug 28 11:29:00 2004 From: david@thekramers.net (David Kramer) Date: Sat, 28 Aug 2004 11:29:00 -0000 Subject: "Arg list too long" during bootstrap Message-ID: I am bootstrapping gcc 3.4.0 on AIX 5.2 from a binary 3.3.3 I downloaded (compiled for 5.1: I could not find a 5.2 one). The command I used is: ../gcc340src/configure --enable-languages=c,c++ --prefix=/opt/gcc3.4.0 --with-cpu-rs64a make -j 12 bootstrap $CC=/usr/local/bin/gcc -mcpu=rs64a About an hour and a half into the process, I get this: generating symbol list for `libstdc++.la' nm -B -X32_64 -BCpg .libs/allocator.o .libs/codecvt.o .libs/complex_io.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/globals_locale.o .libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/locale-inst.o .libs/locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-inst.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .libs/c++locale.o ../libmath/.libs/libmath.a ../libsupc++/.libs/libsupc++convenience.a | awk '{ if ((($2 == "T") || ($2 == "D") || ($2 == "B")) && (substr($3,1,1) != ".")) { print $3 } }' | sort -u > .libs/libstdc++.exp /dkramer/bldgcc340wa/gcc/xgcc -shared-libgcc -B/dkramer/bldgcc340wa/gcc/ -nostdinc++ -L/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src -L/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src/.libs -B/opt/gcc3.4.0/powerpc-ibm-aix5.2.0.0/bin/ -B/opt/gcc3.4.0/powerpc-ibm-aix5.2.0.0/lib/ -isystem /opt/gcc3.4.0/powerpc-ibm-aix5.2.0.0/include -isystem /opt/gcc3.4.0/powerpc-ibm-aix5.2.0.0/sys-include -pthread -shared -o .libs/libstdc++.so.6 .libs/allocator.o .libs/codecvt.o .libs/complex_io.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/globals_locale.o .libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/locale-inst.o .libs/locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-inst.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .libs/c++locale.o -L/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src -L/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src/.libs -lm ../libmath/.libs/libmath.a -lm ../libsupc++/.libs/libsupc++convenience.a -lm -L/dkramer/bldgcc340wa/gcc/pthread -L/dkramer/bldgcc340wa/gcc -L/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/pthread -L/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0 -L/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/../../../pthread -L/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/../../.. -lgcc_s_pthread -lpthreads -lc -lgcc_s_pthread -lm -lgcc_s_pthread -lpthreads -lc -lgcc_s_pthread -Wl,-G -Wl,-bE:.libs/libstdc++.exp -Wl,-bnoentry ${wl}-berok xgcc: installation problem, cannot exec `/dkramer/bldgcc340wa/gcc/collect2': Arg list too long make[7]: *** [libstdc++.la] Error 1 make[7]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src' make[6]: *** [all-recursive] Error 1 make[6]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3' make[5]: *** [all] Error 2 make[5]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3' make[4]: *** [multi-do] Error 1 make[4]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/libstdc++-v3' make[3]: *** [all-multi] Error 2 make[3]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/libstdc++-v3' make[2]: *** [all] Error 2 make[2]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/libstdc++-v3' make[1]: *** [all-target-libstdc++-v3] Error 2 make[1]: Leaving directory `/dkramer/bldgcc340wa' make: *** [bootstrap] Error 2 *** Endinging 'make -j 12 bootstrap' at 0408271707 This is the second time I saw this. After the first time, I STWF and found that it could mean the commands were too long (due to paths), so I moved everything to my home directory so all the paths are shorter. Still got it, now I'm down three hours. Is there anything else that can cause this, or a way around it? Thanks in advance. From bjg@network-theory.co.uk Sat Aug 28 23:51:00 2004 From: bjg@network-theory.co.uk (Brian Gough) Date: Sat, 28 Aug 2004 23:51:00 -0000 Subject: "Arg list too long" during bootstrap In-Reply-To: David Kramer's message of "Fri, 27 Aug 2004 17:24:48 -0400 (EDT)" References: Message-ID: <87vff3einw.fsf@network-theory.co.uk> David Kramer writes: > I am bootstrapping gcc 3.4.0 on AIX 5.2 from a binary 3.3.3 I downloaded > (compiled for 5.1: I could not find a 5.2 one). > ... > xgcc: installation problem, cannot exec > `/dkramer/bldgcc340wa/gcc/collect2': Arg list too long > > This is the second time I saw this. After the first time, I STWF and found > that it could mean the commands were too long (due to paths), so I moved > everything to my home directory so all the paths are shorter... > > Is there anything else that can cause this, or a way around it? Generally it is the number of arguments that is the issue. There is usually a way to increase the limit with a kernel parameter (via smitty chgsys on AIX, I think). -- Brian Gough Network Theory Ltd, Publishing "An Introduction to GCC" --- http://www.network-theory.co.uk/gcc/ From foskey@optushome.com.au Sun Aug 29 15:26:00 2004 From: foskey@optushome.com.au (Ken Foskey) Date: Sun, 29 Aug 2004 15:26:00 -0000 Subject: "Arg list too long" during bootstrap In-Reply-To: <87vff3einw.fsf@network-theory.co.uk> References: <87vff3einw.fsf@network-theory.co.uk> Message-ID: <1093692558.1729.302.camel@froddo.foskey.org.au> On Sat, 2004-08-28 at 19:06, Brian Gough wrote: > Generally it is the number of arguments that is the issue. There is > usually a way to increase the limit with a kernel parameter (via > smitty chgsys on AIX, I think). arg lists are generally the shell not system. If you can figure out a script name you could try switching the #!/bin/sh line to your bash line. ksh (sh in aix generally) has a 1k or 2k limit whereas bash has 4k. You could also tweak the script to use xargs if appropriate. -- Thanks KenF OpenOffice.org developer From slamb@slamb.org Mon Aug 30 06:44:00 2004 From: slamb@slamb.org (Scott Lamb) Date: Mon, 30 Aug 2004 06:44:00 -0000 Subject: Upgrade "may not respond to" warning to error Message-ID: <2ECF1286-F94D-11D8-8E7F-000A95891440@slamb.org> I'd like to have warnings like this: someFile.m:XXX:warning: `SomeObjcClass' may not respond to `-someMessage:' become errors, while not affecting other warnings. So I have two questions: 1) What's the flag for this message? I see -Wundeclared-selector, but that seems to be a slightly different case. 2) Is it possible to do something like -Werror on just some warnings? I'd like some other types of warnings (say, the signedness ones) to be just warnings. I want to see them, but I don't want them to cause compilation to fail. Thanks, Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: From marcel.lanz@ds9.ch Mon Aug 30 08:24:00 2004 From: marcel.lanz@ds9.ch (Marcel Lanz) Date: Mon, 30 Aug 2004 08:24:00 -0000 Subject: build based on a binary only distribution Message-ID: <20040829152557.GA32234@ds9.ch> I have a binary only distrubution of the gcc suite (binutils, newlib, gcc). I wan't to build the equal toolchain for an another platform. Can I do that with the help of the given binaries ? Can those binaries "say me" how they where built ? Can the specs file be a help for that ? Marcel From arno.wilhelm@profile.co.at Mon Aug 30 08:33:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Mon, 30 Aug 2004 08:33:00 -0000 Subject: build based on a binary only distribution In-Reply-To: <20040829152557.GA32234@ds9.ch> References: <20040829152557.GA32234@ds9.ch> Message-ID: <1093848289.2698.1.camel@dione.profile.co.at> > I have a binary only distrubution of the gcc suite (binutils, newlib, gcc). I wan't to > build the equal toolchain for an another platform. Can I do that with the help of the > given binaries ? Can those binaries "say me" how they where built ? That might help: > gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) Arno From snodx@hotmail.com Mon Aug 30 08:40:00 2004 From: snodx@hotmail.com (snodx@hotmail.com) Date: Mon, 30 Aug 2004 08:40:00 -0000 Subject: Spam: Can macros be expanded only during the start of a program? Message-ID: <00a801c48e6c$9911a8a0$940318ac@mahindrabt.com> Hi everybody, I am trying out a rather complex build of an open source package containing some hundreds of '.c' and '.h' modules. I am getting stuck up at one point. The portion of the code that is failing goes something like this (in pseudocode language) .......Statement.......... .......Statement.......... MACRO EXPANSION .......Statement.......... .......Statement.......... The macro is mapped to a function and the expansion occurs in between some set of statements. The make is failing at this line with the error: MACRO EXPANSION Invalid statement I am looking into the problem. However I just wanted to know one thing (a newbie question you could say), just as in between a set of statements you cant declare a new variable by saying "int x" or something is it also the case that macros can only be expanded only at the declaration-of-variables stage? Thanks in advance. SNODX From snodx@hotmail.com Mon Aug 30 09:43:00 2004 From: snodx@hotmail.com (snodx@hotmail.com) Date: Mon, 30 Aug 2004 09:43:00 -0000 Subject: Last posting not a spam. "Spam" keyword getting prepended automatically Message-ID: <00bc01c48e6d$bd0494b0$940318ac@mahindrabt.com> Hi list, I observed that my last posting got prepended with the word "Spam" whereas I am not spamming the list at all. Can the list administrator please look into this? Thanks in advance. SNODX From hueffner@informatik.uni-tuebingen.de Mon Aug 30 10:52:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Mon, 30 Aug 2004 10:52:00 -0000 Subject: Spam: Can macros be expanded only during the start of a program? In-Reply-To: <00a801c48e6c$9911a8a0$940318ac@mahindrabt.com> (snodx@hotmail.com's message of "Mon, 30 Aug 2004 14:07:34 +0530") References: <00a801c48e6c$9911a8a0$940318ac@mahindrabt.com> Message-ID: <87y8jx81dd.fsf@informatik.uni-tuebingen.de> writes: > I am looking into the problem. However I just wanted to know one > thing (a newbie question you could say), just as in between a set of > statements you cant declare a new variable by saying "int x" or > something is it also the case that macros can only be expanded only > at the declaration-of-variables stage? No. -- Falk From learning_c@hotmail.com Mon Aug 30 11:17:00 2004 From: learning_c@hotmail.com (learning c++) Date: Mon, 30 Aug 2004 11:17:00 -0000 Subject: Which header should I include for "reverse" Message-ID: Hi, Everyone: I compiled a short program to use "reverse" like this: #include #include int main() { double A[6] = { 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 }; reverse(A, A + 6); for (int i = 0; i < 6; ++i) std::cout << "A[" << i << "] = " << A[i]; return 0; } But the error is: reverse.cpp: In function `int main()': reverse.cpp:7: error: `reverse' undeclared (first use this function) reverse.cpp:7: error: (Each undeclared identifier is reported only once for each function it appears in.) Thanks in advance! _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From arno.wilhelm@profile.co.at Mon Aug 30 12:08:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Mon, 30 Aug 2004 12:08:00 -0000 Subject: Which header should I include for "reverse" In-Reply-To: References: Message-ID: <1093863119.2698.4.camel@dione.profile.co.at> Have not tried it out but maybe "using namespace std;" or "std::reverse" would help ? regards, Arno On Mon, 2004-08-30 at 11:43, learning c++ wrote: > Hi, Everyone: > > I compiled a short program to use "reverse" like this: > > #include > #include > > int main() { > > double A[6] = { 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 }; > reverse(A, A + 6); > for (int i = 0; i < 6; ++i) > std::cout << "A[" << i << "] = " << A[i]; > return 0; > } > > But the error is: > reverse.cpp: In function `int main()': > reverse.cpp:7: error: `reverse' undeclared (first use this function) > reverse.cpp:7: error: (Each undeclared identifier is reported only once for > each function it appears in.) > > Thanks in advance! > _________________________________________________________________ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail -- Arno Wilhelm proFILE Computersysteme GmbH From help@hotmail.com Mon Aug 30 12:46:00 2004 From: help@hotmail.com (help@hotmail.com) Date: Mon, 30 Aug 2004 12:46:00 -0000 Subject: Help. Message-ID: Hello: I am Chinese. I have some trouble. Can you help me ? I have paypal account ,but i can't get paypal money in China. Do you have paypal ? If you have ,i want to send money to you ,then you return the money to me by western union. I give you some fee. For example: I send u $500, i will give you $50,you return $450USD. Are you agree? If you agree with me ,please contact me , my icq is : 277851088 Thank you I wait your reply. From eljay@adobe.com Mon Aug 30 16:01:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 30 Aug 2004 16:01:00 -0000 Subject: Upgrade "may not respond to" warning to error In-Reply-To: <2ECF1286-F94D-11D8-8E7F-000A95891440@slamb.org> References: <2ECF1286-F94D-11D8-8E7F-000A95891440@slamb.org> Message-ID: <6.1.2.0.2.20040830065939.01f64ec0@iplan-mn.corp.adobe.com> Hi Scott, >What's the flag for this message? I'm not sure. (I haven't familiarized myself with Objective-C. Which is ironic, since I'm an OS X person.) Refer to ... http://gcc.gnu.org/onlinedocs/gcc-3.4.1/gcc/Objective-C-Dialect-Options.html http://gcc.gnu.org/onlinedocs/gcc-3.4.1/gcc/Warning-Options.html >Is it possible to do something like -Werror on just some warnings? No. It's possible to doing something similar, using one of three different strategies: 1) edit the GCC source code and make the identified warnings errors. Rebuild your custom GCC. 2) post-process the output (using sed, for instance) and "upgrade" warnings to errors. Not quite the same thing, doesn't abort the compile, but may be "good enough". You can use that in conjunction with grep to detect for the upgraded warnings, and abort a make file by returning a failing error code. 3) have your build process perform two passes. The first pass enables all the warnings you want to see, the second pass enable only the warnings you want to be elevated to errors and turn on the -Werror flag. Those are just a few ideas off the top of my head. HTH, --Eljay From eljay@adobe.com Mon Aug 30 16:09:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 30 Aug 2004 16:09:00 -0000 Subject: Help Needed In-Reply-To: <20040830122911.24797.qmail@webmail17.rediffmail.com> References: <20040830122911.24797.qmail@webmail17.rediffmail.com> Message-ID: <6.1.2.0.2.20040830074447.01e9a420@iplan-mn.corp.adobe.com> Hi Karthik, This will do what you want... http://spirit.sourceforge.net HTH, --Eljay From steve@millersnet.net Mon Aug 30 16:19:00 2004 From: steve@millersnet.net (steve@millersnet.net) Date: Mon, 30 Aug 2004 16:19:00 -0000 Subject: how to combine gcc and binutils source into one tree Message-ID: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> >they have common directories libiberty,include,texinfo,config, etc.... >what is the best way to merge them? > > >thanks in advance >Steven I ask this question last week, is this not the right list for this question? From eljay@adobe.com Mon Aug 30 16:52:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 30 Aug 2004 16:52:00 -0000 Subject: how to combine gcc and binutils source into one tree In-Reply-To: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> References: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> Message-ID: <6.1.2.0.2.20040830110349.01e48f90@iplan-mn.corp.adobe.com> Hi Steve, >I ask this question last week, is this not the right list for this question? This is the right list for your question. This list is a user-community volunteer list. Questions are posed by anyone, worldwide, and answers are provided by anyone, worldwide. Those who regularly answer questions are, what I'd call, self-nominated "experts" on GCC. There's only a few that are part of FSF or GCC developers per se. So if you ask a question that no one on the "panel of experts" can answer, you end up with (in radio terms) dead air. I know that this doesn't answer your initial question, but it does explain why no one volunteered an answer. I, for one, do not know the answer to your initial question. I'm more of a "C++ language lawyer" than a "nitty gritty internals of GCC guru". --Eljay From david@thekramers.net Mon Aug 30 17:04:00 2004 From: david@thekramers.net (David Kramer) Date: Mon, 30 Aug 2004 17:04:00 -0000 Subject: how to combine gcc and binutils source into one tree In-Reply-To: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> References: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> Message-ID: On Mon, 30 Aug 2004 steve@millersnet.net wrote: > >they have common directories libiberty,include,texinfo,config, etc.... > >what is the best way to merge them? > > > > > >thanks in advance > >Steven > > I ask this question last week, is this not the right list for this question? I will give it my best shot, but I am acutally new to compiling gcc/binutils myself. Gaining Way Too Much experience in it in the last week or so though. In combining projects like this in general, if those common directories have completely identical contents, then you can pull it off. The way you integrate them is by changing the master Makefile to call the new directories too, and to make sure the install targets for the new directories get called too. If I were a betting man (which I'm not), I would try something devious like: - Untar package A into DIR1 - Untar package B into DIR2 - Copy the unique directories from package B to DIR1 - Copy the main Makefile of package B to $DIR1/Makefile.packageb - cd $DIR1 - Configure and make package A - Make package B using the makefile Makefile.packageb One obstacle I fear is that their configure scripts will need different things. I would be fascinated to hear whether this works or not. Let me know. I would also be interested in hearing why you want to do this though. TO save 20 minutes of compile time? ---------------------------------------------------------------------------- DDDD David Kramer david@thekramers.net http://thekramers.net DK KD DKK D You don't usually hear "hydraulics" and "simplicity" DK KD in the same sentence. DDDD Cathy Rogers, Junkyard Wars From steve@millersnet.net Mon Aug 30 17:10:00 2004 From: steve@millersnet.net (steve@millersnet.net) Date: Mon, 30 Aug 2004 17:10:00 -0000 Subject: how to combine gcc and binutils source into one tree Message-ID: <2087.192.168.0.4.1093884933.squirrel@nautilus.tsunami.us> the linux kernel docs say use gcc 2.95.3 and the latest binutils. However some packages like glibc won't build with 2.95.3 so you end up with 2 versions of gcc and 2 versions of binutils on the same system. While you can manage this, should you get your wires crossed it could make for some strange results. Perhaps I'm making the wrong approach, in the end I just want two seperate toolchains. Since I will be putting both versions on multiple machines I'm looking for a good way to package everything. I'll post any success in doing this. From david@thekramers.net Mon Aug 30 17:22:00 2004 From: david@thekramers.net (David Kramer) Date: Mon, 30 Aug 2004 17:22:00 -0000 Subject: how to combine gcc and binutils source into one tree In-Reply-To: <2087.192.168.0.4.1093884933.squirrel@nautilus.tsunami.us> References: <2087.192.168.0.4.1093884933.squirrel@nautilus.tsunami.us> Message-ID: On Mon, 30 Aug 2004 steve@millersnet.net wrote: > the linux kernel docs say use gcc 2.95.3 and the latest binutils. However > some packages like glibc won't build with 2.95.3 so you end up with 2 > versions of gcc and 2 versions of binutils on the same system. While you > can manage this, should you get your wires crossed it could make for some > strange results. Perhaps I'm making the wrong approach, in the end I just > want two seperate toolchains. Since I will be putting both versions on > multiple machines I'm looking for a good way to package everything. I'll > post any success in doing this. Ah! I see. I'm going through similar issues now. I think the solution to your problem is not to control how they are built, but how they are installed. If you configure and make them with --with-prefix=, you can install them in different places, and have your $PATH set up one way or another to use one version or another. In my login scripts I have: $ORIGPATH- the path without any devel tools, so I can always get a clean path without duplcation. $PATH- Set to $ORIGPATH $GCC340PATH- Set to the bin directories for gcc 3.4.0 toolchain $GCC333PATH- Set to the bin directories for gcc 3.3.3 toolchain $XLCPATH- Set to the bin directories for the native xlC toolchain To switch toolchains, I just issue a command like export PATH=$GCC340PATH:$ORIGPATH Or make scripts (remember to source them, not run them) or aliases to do the same thing. If you decide to install them under opt, use --with_prefix=/opt/gcc3.3.3 or --with_prefix==/opt/gccc3.4.0 or whatever. To package them all up, install all the versions on one machine, and tar up the installed versions like "cd /opt; tar cvf /tmp/gcc_all.tar gcc*". Everything goes under the prefix directory, so that should work. ---------------------------------------------------------------------------- DDDD David Kramer david@thekramers.net http://thekramers.net DK KD DKK D You don't usually hear "hydraulics" and "simplicity" DK KD in the same sentence. DDDD Cathy Rogers, Junkyard Wars From learning_c@hotmail.com Mon Aug 30 17:25:00 2004 From: learning_c@hotmail.com (learning c++) Date: Mon, 30 Aug 2004 17:25:00 -0000 Subject: function object, function pointer and function. Message-ID: Hi, Everyone: I compiled a short code that invovles function object and function pointer. in the line: int count1 = count_if(v1.begin(), v1.end(), &lessThan20Function); I used the funtion poiter to pass the address of function. It works very well, However, when I deleted the symbol "&", it still works. "lessThan20Function" is the name of function. Can we use the function name as an argument? What is the advantage of function object? Thanks in advanace! #include #include #include using namespace std; bool lessThan20Function(int value) { return value < 20; } class LessThan20 { public: bool operator() (int value) const { return value < 20; } }; int main() { int iarr[10] = {2,4,55,6,66,10,22,14,70,1234}; vector v1(iarr, iarr+10); LessThan20 lt20; // count_if(start_iterator, end_iterator, predicate); // Pointer to a function as argument int count1 = count_if(v1.begin(), v1.end(), &lessThan20Function); cout << "There are " << count1 << " values less than 20" << endl; // Function object as argument int count2 = count_if(v1.begin(), v1.end(), lt20); cout << "There are " << count2 << " values less than 20" << endl; return 0; ] _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail From steve@millersnet.net Mon Aug 30 17:42:00 2004 From: steve@millersnet.net (steve@millersnet.net) Date: Mon, 30 Aug 2004 17:42:00 -0000 Subject: how to combine gcc and binutils source into one tree Message-ID: <2162.192.168.0.4.1093886737.squirrel@nautilus.tsunami.us> ok that seems to be an easier way to handle things. I'm wondering which will work better when configuring gcc use --with-prefix=/opt/gcc-2.95.3 and when configuring binutils use --with-prefix=/opt/binutils-2.15 this would keep everything contained to their own directories or gcc use --with-prefix=/opt/gnu and binutils use --with-prefix=/opt/gnu ..... would the latter work as well seeing how both gcc and binutils have common components? From eljay@adobe.com Mon Aug 30 18:22:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 30 Aug 2004 18:22:00 -0000 Subject: function object, function pointer and function. In-Reply-To: References: Message-ID: <6.1.2.0.2.20040830121802.01f2b8d0@iplan-mn.corp.adobe.com> Hi, In the situation you presented, the & in your "int count1 = count_if(v1.begin(), v1.end(), &lessThan20Function);" line is superfluous. Although it is perfectly good code, and acceptable to all compilers. In my experience, it would be omitted. By convention. Also in my experience, there is a preference to function objects over function pointers. For some really neat stuff, the BOOST (www.boost.org) library has a lambda library, which would allow you to put the body of the predicate right in your count_if statement -- and in a quite abbreviated form. It'd look something like... int count = count_if(v1.begin(), v1.end(), _1 > 20); HTH, --Eljay From david@thekramers.net Mon Aug 30 18:28:00 2004 From: david@thekramers.net (David Kramer) Date: Mon, 30 Aug 2004 18:28:00 -0000 Subject: how to combine gcc and binutils source into one tree In-Reply-To: <2162.192.168.0.4.1093886737.squirrel@nautilus.tsunami.us> References: <2162.192.168.0.4.1093886737.squirrel@nautilus.tsunami.us> Message-ID: On Mon, 30 Aug 2004 steve@millersnet.net wrote: > ok that seems to be an easier way to handle things. I'm wondering which > will work better when configuring gcc use --with-prefix=/opt/gcc-2.95.3 > and when configuring binutils use --with-prefix=/opt/binutils-2.15 this > would keep everything contained to their own directories or gcc use > --with-prefix=/opt/gnu and binutils use --with-prefix=/opt/gnu ..... would > the latter work as well seeing how both gcc and binutils have common > components? Each package needs a different --with-prefix option. That's the least risky way to do it. You can settle any conflicts with your $PATH, and you can even try differernt gcc's with different binutil's that way. Though doing --with-prefix=/opt/gnu/gcc-2.95.3 --with-prefix=/opt/gnu/binutils-2.15 ... ... wouldn't be a bad idea, so you can just tar up /opt/gnu. -- DDDD DK KD DKK D Bush/Cheney '04: Putting the "Con" in Conservative DK KD DDDD From david@thekramers.net Mon Aug 30 21:14:00 2004 From: david@thekramers.net (David Kramer) Date: Mon, 30 Aug 2004 21:14:00 -0000 Subject: install-sh not found during make install 3.4.0 Message-ID: Thanks to the help from this list on the arg list too long, I got gcc 3.4.0 compiled under AIX. When I tried to make install, I got, at various points, "/usr/local/bin/bash: ../gcc340src/install-sh: A file or directory in the path name does not exist.". When I put the full path of install-sh in the INSTALL variable in the Makefile, it works. The directory I was getting the source from (../gcc340src) is actually a symlink to another directory. Could that be the root of the problem? When I set the full path in the Makefile, I used the real path. ------------------------------------------------------------------- DDDD David Kramer http://thekramers.net DK KD "On two occasions, I have been asked [by members of DKK D Parliament], 'Pray, Mr. Babbage, if you put into the machine DK KD wrong figures, will the right answers come out?' I am not DDDD able to rightly apprehend the kind of confusion of ideas that could provoke such a question." -- Charles Babbage From saravanaprasads@yahoo.co.in Mon Aug 30 23:46:00 2004 From: saravanaprasads@yahoo.co.in (=?iso-8859-1?q?Saravana=20Prasad?=) Date: Mon, 30 Aug 2004 23:46:00 -0000 Subject: Regarding building GCC/glibc for MIPS targets Message-ID: <20040830182829.24090.qmail@web8505.mail.in.yahoo.com> Hi, ???? I'm trying to build GCC 3.2.3 (x86->mips) and LIBC 2.3.2 for various MIPS targets. I need the tool chain for MIPS little-endian/big-endian mips1/mips3 ISA. I was successful in building the mips-xxx-linux-gnu target. The tool chain works fine for big-endian mips32 target. But for little endian target, it is failing as the correct library (endian) was not built. Here are my questions. 1. How to build the tools chain for various target combinations ? 2. Is it possible to just build one compiler (instead f mipsel-xx, mipseb-xxx etc) and a set of libraries to do the job ? If yes, do I need to use multilib option ? If so, how to use it ? I tried with the following option, but only the big-endian target got built. MULTILIB_OPTIONS = msoft-float/msingle-float EL/EB mips1/mips3 MULTILIB_DIRNAMES = soft-float single el eb mips1 mips3 ???? Please advice. TIA, Saravana ________________________________________________________________________ Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony From david@thekramers.net Tue Aug 31 02:54:00 2004 From: david@thekramers.net (David Kramer) Date: Tue, 31 Aug 2004 02:54:00 -0000 Subject: AIX architecture problems continued Message-ID: Background: AIX 5.2 box. My mission is to port my company's application from AIX's native xlC compiler to the GNU toolchain. I bootstraped gcc 3.4.0 from a gcc 3.3.3 (build for AIX5.1) I downloaded. I built gcc with an architecture of "powerpc-ibm-aix5.2.0.0" using the -mcpu=rs64a flag. This is on a PowerPC_RS64-II according to lsattr. I have a binutils2.14 built by someone else into /opt/local/bin. I can tell you this about it: /opt/local/bin/ld: supported targets: aixcoff-rs6000 aix5coff64-rs6000 srec symbolsrec tekhex binary ihex /opt/local/bin/ld: supported emulations: aix5ppc /opt/local/bin/ld: emulation specific options: no emulation specific options. /opt/local/bin/ld -v GNU ld version 2.14 20030612 I have a binutils 2.15 that I just built myself using the gcc 3.4.0 compiler I built as outlined above, into /opt/binutils2.15/bin. I also have ld, etc, from the native xlC toolchain in /usr/bin. I wrote a little test program that just does some << and >> and stringstream conversions. Source available if you think it's important. When I try using the new compiler with the stock ld: -------------------------------- ~/build/test> export PATH=$GCC340PATH:$ORIGPATH ~/build/test> which gcc /opt/gcc3.4.0/bin/gcc ~/build/test> which ld /usr/bin/ld ~/build/test> g++ -o piddle piddle.cpp && ./piddle Before defining stringstream here After defining stringstream the process id is 94776. the number is: 56 -------------------------------- the program works fine, no errors. When I try using the new compiler with the old gnu binutils: -------------------------------- ~/build/test> export PATH=$GCC340PATH:/usr/local/bin:$ORIGPATH ~/build/test> g++ -o piddle piddle.cpp && ./piddle Before defining stringstream here After defining stringstream the process id is 28258. the number is: 56 -------------------------------- the program works fine, no errors. When I try using the new compiler with the new gnu binutils: -------------------------------- ~/build/test> export PATH=$GCC340PATH:$BINUTILSPATH:$ORIGPATH ~/build/test> which gcc /opt/gcc3.4.0/bin/gcc ~/build/test> which ld /opt/binutils2.15/bin/ld ~/build/test> g++ -o piddle piddle.cpp && ./piddle Before defining stringstream here Segmentation fault (core dumped) -------------------------------- The program dies on this line: stringstream sstr("safas"); I've tried with with various constructors, too, with the same results. Since I'm using the same exact source code and the same compiler, and only the linking process has changed in my test, it seems to me that the problem has to be the linker, no? BTW, the reason I am trying to build a new binutils, is because when I link my application, and some more complex test code, I get errors like: /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_divdi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_moddi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_udivdi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_umoddi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_udivmoddi4.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc_eh.a(unwind-dw2.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc_eh.a(unwind-dw2-fde.o)' is incompatible with rs6000:6000 output However, I'm not so sure it's the linker. What do you think? -- DDDD DK KD I am a nobody DKK D Nobody is perfect DK KD Therefore, I am perfect. DDDD From msharov@talentg.com Tue Aug 31 03:22:00 2004 From: msharov@talentg.com (Mike Sharov) Date: Tue, 31 Aug 2004 03:22:00 -0000 Subject: How can I tell the compiler to not store excessively? Message-ID: <4133BB9F.3010705@talentg.com> Dear gcc-help, I am trying to write several inline assembly functions to facilitate use of MMX instructions and I would like for them to be concatenated without transfer in and out of registers between calls if the data is already loaded in a register. Example: =========================================== #include typedef int mmx_t __attribute__ ((mode(V8QI))); inline void padd (const char* p, char* r) { asm ("paddb %1, %0" : "=&y"(*(mmx_t*)r) : "y"(*(const mmx_t*)p), "0"(*(mmx_t*)r)); } inline void psub (const char* p, char* r) { asm ("psubb %1, %0" : "=&y"(*(mmx_t*)r) : "y"(*(const mmx_t*)p), "0"(*(mmx_t*)r)); } int main (void) { char v1[8], v2[8]; padd (v1, v2); psub (v1, v2); printf ("v2[3] = %d\n", v2[3]); return (0); } =========================================== Here I would like to see v1 and v2 loaded into registers before the call to padd and not leave them until the return from psub. Now, gcc already can do this for the read-only v1, generating the following (-O3 -march=athlon-mp): =========================================== pxor %mm0, %mm0 movl %esp, %ebp .LCFI1: subl $24, %esp .LCFI2: movq -8(%ebp), %mm1 andl $-16, %esp #APP paddb %mm0, %mm1 #NO_APP movq %mm1, -8(%ebp) subl $16, %esp #APP psubb %mm0, %mm1 #NO_APP movq %mm1, -8(%ebp) movsbl -5(%ebp),%eax movl $.LC0, (%esp) movl %eax, 4(%esp) call printf =========================================== Here %mm0 is not reloaded because it remains the same value for both padd and psub calls. However, the value from %mm1 is stored into v2 twice; the first time after padd and the second time after psub. It is understandable that the optimizer would do this, because, for example, several threads could be accessing v2 concurrently. Is it possible to add some directives to the source code above to tell the optimizer that it is ok to keep v2 in a register until something (like the printf) actually asks for its contents through another method? -- Mike Sharov msharov@talentg.com From chris.fernando@med.monash.edu.au Tue Aug 31 03:57:00 2004 From: chris.fernando@med.monash.edu.au (Chris Fernando) Date: Tue, 31 Aug 2004 03:57:00 -0000 Subject: GNU installation Message-ID: <4133BFF2.1050400@med.monash.edu.au> Dear gcc-help, Is there a way of getting GCC installed on Linux if there is no compiler already installed on the system? The machine does not have rpm installed, either. It has been suggested that I could try using rpm2tar on an RPM binary, but I've also been told I will get a lot of gcclib problems if I do that. Any advice? Thanks -- Mr Chris Fernando Computer Systems Officer IT & MULTIMEDIA GROUP Medicine, Nursing & Health Sciences Mail: Level 3, Bld 15, Monash University Vic 3800 Phone: 9905 1335 Fax: 9905 8134 Email: chris.fernando@med.monash.edu.au Jobdesk: http://jobdesk.med.monash.edu.au ITM Website: http://itm.med.monash.edu.au From dhairesh@gmail.com Tue Aug 31 03:58:00 2004 From: dhairesh@gmail.com (Oza Dhairesh) Date: Tue, 31 Aug 2004 03:58:00 -0000 Subject: function calls before variable declarations does not give error in gcc? Message-ID: <3aa41a650408302022774d7486@mail.gmail.com> Hi, The following code does not give an error wth gcc void fun(int a){ printf("there u go %d\n",a);} int main() { char abc[10] = "the"; int a1 = 10; fun(10); int a = 1; } gcc --version gave the following o/p: gcc (GCC) 3.3.1 (SuSE Linux) Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. while wth a compiler that gave the following o/p wth gcc --version 2.96 I got the following error: test1.c: In function `main': test1.c:10: parse error before `int' why this difference? From kuganv@gmail.com Tue Aug 31 05:10:00 2004 From: kuganv@gmail.com (Kugan Vivekanandarajah) Date: Tue, 31 Aug 2004 05:10:00 -0000 Subject: constructing cfg from linked binary for arm Message-ID: <4217037d040830205772574bf2@mail.gmail.com> [Might be off topic for this list, but I could not find any list which discusses the arm gcc backend] To study the program behavior, after being linked (which will be used for application specific architecture tuning), I need to construct a control flow graph for the whole program. My target architecture is arm. I have following questions 1) Can function return take place with any other instruction other than the following? And also, can I assume that this instructions will be used only for function return a. mov pc, lr b. ldmdb fp, {r4, fp, sp, pc} 2) Instructions like the following: what is the genral use of them? a. ldr pc, [r4]. #4 b. mov pc, r8 Can I get these informations by looking arm.md file used in GCC. How des gcc generates code based on this md file. Any points, links or documents about this will be very helpful Thanks in advance, -kgn From eljay@adobe.com Tue Aug 31 05:22:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 31 Aug 2004 05:22:00 -0000 Subject: function calls before variable declarations does not give error in gcc? In-Reply-To: <3aa41a650408302022774d7486@mail.gmail.com> References: <3aa41a650408302022774d7486@mail.gmail.com> Message-ID: <6.1.2.0.2.20040830225651.01f46e20@iplan-mn.corp.adobe.com> Hi Oza, I believe that's actually not an error, according to C99. GCC 2.96 (a misnomer for a maverick non-GCC release, since there wasn't a GCC 2.96, GCC went from 2.95 to 3.0) is probably following C89 standards. HTH, --Eljay From dhairesh@gmail.com Tue Aug 31 06:31:00 2004 From: dhairesh@gmail.com (Oza Dhairesh) Date: Tue, 31 Aug 2004 06:31:00 -0000 Subject: function calls before variable declarations does not give error in gcc? In-Reply-To: <6.1.2.0.2.20040830225651.01f46e20@iplan-mn.corp.adobe.com> References: <3aa41a650408302022774d7486@mail.gmail.com> <6.1.2.0.2.20040830225651.01f46e20@iplan-mn.corp.adobe.com> Message-ID: <3aa41a650408302210d03ca6d@mail.gmail.com> Hi Thanks Eljay. But even gcc -std=c89 dosnt give an error!! BR Oza On Mon, 30 Aug 2004 22:58:44 -0500, Eljay Love-Jensen wrote: > Hi Oza, > > I believe that's actually not an error, according to C99. > > GCC 2.96 (a misnomer for a maverick non-GCC release, since there wasn't a > GCC 2.96, GCC went from 2.95 to 3.0) is probably following C89 standards. > > HTH, > --Eljay > > From bdubbs@swbell.net Tue Aug 31 06:51:00 2004 From: bdubbs@swbell.net (Bruce Dubbs) Date: Tue, 31 Aug 2004 06:51:00 -0000 Subject: Building gcc-3.4.1 Ada Message-ID: <41340B2E.6030206@swbell.net> I'm having quite a problem building Ada with 3.4.1. I set up and run configure and make bootstrap fine, but I can never get the gnatlibs_and_tools target to show up in the Makefile, so the documented process of cd gcc make gnatlibs_and_tools fails. I am using an Ada enabled base compiler and gnatbind, gnat, gnatls, etc are built. I'm not that familiar with Ada, so I'm not sure if everything that is supposed to be built is now done in the make bootstrap phase or not. Please advise. -- Bruce Dubbs From parmarp@charter.net Tue Aug 31 06:59:00 2004 From: parmarp@charter.net (ritesh parmar) Date: Tue, 31 Aug 2004 06:59:00 -0000 Subject: a question about inheriting from std::iostream Message-ID: <1093923575.6702.11.camel@nova.dominion.com> I'm not sure if this question has been asked and i couldn't find an example in all of my searches. But I'd like to write a class that would perform substitution of keywords while some other class is reading from it. I was thinking about getting streambuf from ios::rdbuf() and performing all the substitutions and then setting it back but that approach make take some time with big files. If my understanding is correct about how streambuf class works. Can anybody suggest a way of inheriting from iostream and doing the substitution on-the-fly ? From sdodsley@hotmail.com Tue Aug 31 07:10:00 2004 From: sdodsley@hotmail.com (Simon Dodsley) Date: Tue, 31 Aug 2004 07:10:00 -0000 Subject: Problem with g++ on Tru64 5.1B (gcc 3.4.1) Message-ID: >Maybe OpenPKG can help you. It is a cross platform packaging solution >and all CORE packages are known to work on Tru64 5.1. Have a look >http://www.openpkg.org and give it a try. OpenPKG focuses on sources >which implies a chicken-egg problem but you can find unofficial binaries >at http://www.zfos.org/openpkg.html Thanks for the pointer. Tried this again on another alpha and noticed that the gmake install was failing due to install-sh not being found in some of the directories. After copying it in, everything seems to work as expected. Only slight problem is that when I compile I keep getting the following warnings... as0: Warning: , line 0: Unknown architecture name: ev68 as1: Warning: , line 0: Unknown architecture name: ev68 as0: Warning: , line 0: Unknown architecture name: ev68 as1: Warning: , line 0: Unknown architecture name: ev68 Anyone know why this might be? Simon From arno.wilhelm@profile.co.at Tue Aug 31 11:48:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Tue, 31 Aug 2004 11:48:00 -0000 Subject: GNU installation In-Reply-To: <4133BFF2.1050400@med.monash.edu.au> References: <4133BFF2.1050400@med.monash.edu.au> Message-ID: <1093935542.7611.1.camel@dione.profile.co.at> > Is there a way of getting GCC installed on Linux if there is no compiler > already installed on the system? The machine does not have rpm > installed, either. > > It has been suggested that I could try using rpm2tar on an RPM binary, > but I've also been told I will get a lot of gcclib problems if I do that. > > Any advice? You could try to unpack the rpm packet with mc (midnight commander) and put the library's/ececutables etc. in the proper directory by yourself. The spec file should give you a hint on where to put it. Arno From hueffner@informatik.uni-tuebingen.de Tue Aug 31 12:01:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Tue, 31 Aug 2004 12:01:00 -0000 Subject: How can I tell the compiler to not store excessively? In-Reply-To: <4133BB9F.3010705@talentg.com> (Mike Sharov's message of "Mon, 30 Aug 2004 19:43:27 -0400") References: <4133BB9F.3010705@talentg.com> Message-ID: <87brgr236l.fsf@informatik.uni-tuebingen.de> Mike Sharov writes: > I am trying to write several inline assembly functions to facilitate > use of MMX instructions and I would like for them to be concatenated > without transfer in and out of registers between calls if the data is > already loaded in a register. I'd recommend you use try the macros from like _m_paddb. If they don't produce proper code, please file a bug report. -- Falk From suresh@comodogroup.com Tue Aug 31 12:09:00 2004 From: suresh@comodogroup.com (L.Suresh) Date: Tue, 31 Aug 2004 12:09:00 -0000 Subject: Link problems in g++ but not in gcc!! Message-ID: <1093952856.5304.18.camel@Ironwing> Hi, I'm having link problems when i compile my program iptables.cpp with g++. I have the following: /usr/lib/libipq.a /usr/include/libipq.h /usr/share/man/man3/libipq.3.gz I tried to compile like this. g++ -o ipqtest iptables.cpp -lipq <<--- Fails to compile. g++ -o ipqtest iptables.cpp /usr/lib/libipq.a gcc -o ipqtest iptables.c -lipq <-- Compiles!! I get the following error when i compile with g++. But when i change my file name iptables.cpp to iptables.c and compile, it compiles without any problems!! Symbol list of libipq.a is: libipq.o: U bind U close U __errno_location U fprintf U fputc U fputs U free U fwrite U getpid 00000260 T ipq_create_handle 00000550 T ipq_ctl 000003a0 T ipq_destroy_handle 00000000 D ipq_errmap 00000000 b ipq_errno 00000560 T ipq_errstr 00000460 T ipq_get_msgerr 00000470 T ipq_get_packet 00000450 T ipq_message_type 00000090 t ipq_netlink_recvfrom 00000050 t ipq_netlink_sendmsg 00000000 t ipq_netlink_sendto 00000580 T ipq_perror 00000440 T ipq_read 000003d0 T ipq_set_mode 00000480 T ipq_set_verdict 00000240 t ipq_strerror U malloc U recvfrom U select U sendmsg U sendto U socket U stderr U strerror Error while compiling. /tmp/ccEVoYgQ.o(.text+0xf): In function `die(ipq_handle*)': : undefined reference to `ipq_perror(char const*)' /tmp/ccEVoYgQ.o(.text+0x1d): In function `die(ipq_handle*)': : undefined reference to `ipq_destroy_handle(ipq_handle*)' /tmp/ccEVoYgQ.o(.text+0x37): In function `mains(int, char**)': : undefined reference to `ipq_create_handle(unsigned, unsigned)' /tmp/ccEVoYgQ.o(.text+0x6f): In function `mains(int, char**)': : undefined reference to `ipq_set_mode(ipq_handle const*, unsigned char, unsigned)' /tmp/ccEVoYgQ.o(.text+0xa6): In function `mains(int, char**)': : undefined reference to `ipq_read(ipq_handle const*, unsigned char*, unsigned, int)' /tmp/ccEVoYgQ.o(.text+0xd2): In function `mains(int, char**)': : undefined reference to `ipq_message_type(unsigned char const*)' /tmp/ccEVoYgQ.o(.text+0x104): In function `mains(int, char**)': : undefined reference to `ipq_get_msgerr(unsigned char const*)' /tmp/ccEVoYgQ.o(.text+0x12f): In function `mains(int, char**)': : undefined reference to `ipq_get_packet(unsigned char const*)' /tmp/ccEVoYgQ.o(.text+0x154): In function `mains(int, char**)': : undefined reference to `ipq_set_verdict(ipq_handle const*, unsigned, unsigned, unsigned, unsigned char*)' collect2: ld returned 1 exit status Any help would be highly appreciated. Thanks, L.Suresh From eljay@adobe.com Tue Aug 31 12:18:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 31 Aug 2004 12:18:00 -0000 Subject: Link problems in g++ but not in gcc!! In-Reply-To: <1093952856.5304.18.camel@Ironwing> References: <1093952856.5304.18.camel@Ironwing> Message-ID: <6.1.2.0.2.20040831070257.01f81858@iplan-mn.corp.adobe.com> Hi L.Suresh, It appears that the libipq.a is a C ABI library, but the header file(s) for libipq.a are not specified as using the C ABI when compiled with C++. For example, if you look at one of the those header files (I'm guessing "ipq.h") does it have this near the top (AFTER any included header files in the ipq.h): #ifdef __cplusplus extern "C" { #endif ...and this near the bottom... #ifdef __cplusplus } #endif If it doesn't have those C++ guards, then to include the C++-ignorant C header file, you should do this in your iptables.cpp file (I'm just making them up off the top of my head): #include "iptable.h" extern "C" { #include "ipq.h" } #include #include #include Or what I've seen developers do is make a ipq.hpp file that only contains this: extern "C" { #include "ipq.h" } Then your C++ code doesn't look so polluted, and just contains this: #include "iptable.h" #include "ipq.hpp" #include #include #include HTH, --Eljay From eljay@adobe.com Tue Aug 31 12:18:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 31 Aug 2004 12:18:00 -0000 Subject: function calls before variable declarations does not give error in gcc? In-Reply-To: <3aa41a650408302210d03ca6d@mail.gmail.com> References: <3aa41a650408302022774d7486@mail.gmail.com> <6.1.2.0.2.20040830225651.01f46e20@iplan-mn.corp.adobe.com> <3aa41a650408302210d03ca6d@mail.gmail.com> Message-ID: <6.1.2.0.2.20040831070032.02027ec0@iplan-mn.corp.adobe.com> Hi Oza, You're running into a GNU extension to C89, and a standard part of C99. $ gcc -pedantic -std=c99 -W -Wall -Wno-unused-variable c99.c No error messages. $ gcc -pedantic -std=c89 -W -Wall -Wno-unused-variable c99.c c99.c: In function `main': c99.c:11: warning: ISO C89 forbids mixed declarations and code Error messages. HTH, --Eljay From hfpmehtetlxm@yahoo.com Tue Aug 31 14:12:00 2004 From: hfpmehtetlxm@yahoo.com (Robby Mcintyre) Date: Tue, 31 Aug 2004 14:12:00 -0000 Subject: Fw: bore Message-ID: I just received this today, take a look would you? http://www.downloadsaver.com/ref44.html You can just about download any CD album you want to. Not to mention console games and dvd's. I've already downloaded 8 console games and music CD's.. Be sure and let me know once you've seen it - you're going to flip. Theres an area that teaches you how to burn the stuff to CD. I saw a few areas of the movie section, and found titles in there still in theaters - it's nutty. Tell me when you get back. Young From eljay@adobe.com Tue Aug 31 20:35:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 31 Aug 2004 20:35:00 -0000 Subject: Link problems in g++ but not in gcc!! In-Reply-To: <6.1.2.0.2.20040831070257.01f81858@iplan-mn.corp.adobe.com> References: <1093952856.5304.18.camel@Ironwing> <6.1.2.0.2.20040831070257.01f81858@iplan-mn.corp.adobe.com> Message-ID: <6.1.2.0.2.20040831071219.0429e008@iplan-mn.corp.adobe.com> Hi L.Suresh, CAVEAT! If you make an "ipq.hpp" header file that only contains this... extern "C" { #include "ipq.h" } ...that's just fine if ipq.h does not, itself, include any header files. But if it does include any header files, your ipq.hpp should include those header files first. And you should use the same guard that ipq.h uses -- but don't DEFINE it, just trigger off of it. #ifndef ipq_h_once #include "alpha.h" #include extern "C" { #include "ipq.h" } #endif You don't want to compromise those other header files by extern "C"-ing them. If the made-up "alpha.h" is, itself, in the same boat, then do this... #ifndef ipq_h_once #include "alpha.hpp" // "C" wrapper around alpha.h #include extern "C" { #include "ipq.h" } #endif It can turn into a mighty be can-o'-worms if there are lots and lots of header files. Might be easier to instrument (edit) the C header files with the... #ifdef __cplusplus extern "C" { #endif HTH, --Eljay From bdubbs@swbell.net Tue Aug 31 20:58:00 2004 From: bdubbs@swbell.net (Bruce Dubbs) Date: Tue, 31 Aug 2004 20:58:00 -0000 Subject: Building gcc-3.4.1 Ada In-Reply-To: <41340B2E.6030206@swbell.net> References: <41340B2E.6030206@swbell.net> Message-ID: <4134873A.2000900@swbell.net> Bruce Dubbs wrote: > I'm having quite a problem building Ada with 3.4.1. I set up and run > configure and make bootstrap fine, but I can never get the > gnatlibs_and_tools target to show up in the Makefile, so the > documented process of > > cd gcc > make gnatlibs_and_tools > > fails. > > I am using an Ada enabled base compiler and gnatbind, gnat, gnatls, > etc are built. I'm not that familiar with Ada, so I'm not sure if > everything that is supposed to be built is now done in the make > bootstrap phase or not. Sorry to follow up my own post, but I was wrong in the post above, the only files that are created are gnat1 and gnatbind. I was looking at the make install text and made some incorrect assumptions. The process I am using does work for gcc-3.3.3. I'm stumped. -- Bruce From learning_c@hotmail.com Tue Aug 31 22:06:00 2004 From: learning_c@hotmail.com (learning c++) Date: Tue, 31 Aug 2004 22:06:00 -0000 Subject: String and Char in function template Message-ID: Hi, Everyone: I have a short code about function template like this: #include #include using std::cout; template // template parameter list T const &greater(T const &first, T const &second) { return (first > second) ? first : second; } int main() { int a = 1, b = 2; cout << greater(a, b) << '\n'; long c = 4L, d = 3L; cout << greater(c, d) << '\n'; double e = 5.62, f = 3.48; cout << greater(e, f) << '\n'; char g = 'A', h = 'a'; cout << greater(g, h) << '\n'; std::string two("two"), three("three"); cout << greater(two, three) << '\n'; char const *two("two"), *three("three"); cout << greater(two, three) << '\n'; char const *two("two"), *three("three"); cout << greater(two, three) << '\n'; return 0; } when I compile it, the errors are the following: /v/dunix51_alpha/gnu/gcc/lib/gcc-lib/alphaev5-dec-osf5/3.3/include/c++/bits/stl_function.h: In function `int main()': /v/dunix51_alpha/gnu/gcc/lib/gcc-lib/alphaev5-dec-osf5/3.3/include/c++/bits/stl_function.h:188: error: ` template struct std::greater' is not a function, greater.cpp:7: error: conflict with `template const T& greater(const T&, const T&)' greater.cpp:22: error: in call to `greater' greater.cpp:23: error: conflicting types for `const char*two' greater.cpp:21: error: previous declaration as `std::string two' greater.cpp:23: error: conflicting types for `const char*three' greater.cpp:21: error: previous declaration as `std::string three' greater.cpp:23: warning: statement with no effect greater.cpp:23: confused by earlier errors, bailing out What is wrong with my code? In addition, I hope to know something about "const" in "char const *two("two"), *three("three");" and the difference between "using std::cout;" and "using namespace std;" Thanks in advance! _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From soksavik@gmail.com Sun Aug 1 12:12:00 2004 From: soksavik@gmail.com (Stian Oksavik) Date: Sun, 01 Aug 2004 12:12:00 -0000 Subject: Avoiding libgcc_s.so dependency Message-ID: <8ed0eb0c0408010512753c2152@mail.gmail.com> Howdy all, I'm struggling with libgcc_s.so.1. It seems that pretty much any non-trivial program I compile ends up depending on libgcc_s.so.1. Basically, this means that I can't distribute software without also distributing this library, which is problematic for any number of reasons. I've been told to just build static binaries to avoid this problem, but this is not an option on Solaris as Sun does not include all the libraries needed to build static libraries of most software. My goal is to be able to build binaries that avoid dependencies on any third-party libraries, and only depends on Sun's bundled libraries. The current project -- and problem -- is with OpenSSH 3.8.1p1 under Solaris 9/sparc. OpenSSH picks up libcrypto.so.1 from OpenSSL (even though libcrypto.a also exists), and that in turn forces libgcc_s.so.1 into the equation -- no matter what combination of gcc and ld flags I try to keep this from happening. So, two questions: a) What is the purpose of libgcc_s.so.1, and does this purpose outweigh the inconvenience this library causes? (Including one machine we could no longer log into because removing the SMCgcc package from it disabled sshd?) b) Is there ANY way to get rid of this dependency without building a fully static binary? Thanks, -Stian From cheapRasmussen@wolfe.net Sun Aug 1 23:35:00 2004 From: cheapRasmussen@wolfe.net (Ctsavell) Date: Sun, 01 Aug 2004 23:35:00 -0000 Subject: For clients (bridesmaid) Message-ID: Dear chaepsoft customer! We have update our programs list, now we have more and new version programs. Our full catalog with 1500 fresh software titles http://maximized.rubikonaj.com/2/p/ With best regards, Chaepsoft Manager Jason AAdriatic From gcc@yapost.com Mon Aug 2 07:33:00 2004 From: gcc@yapost.com (GCC) Date: Mon, 02 Aug 2004 07:33:00 -0000 Subject: gcc driver behaviour Message-ID: <410E4F5C.1090404@yapost.com> when compile like `gcc -c one.c' find out that cc1 gets arguments like `-quiet -v one.c -quiet -dumpbase one.c -mtune=pentiumpro -auxbase one -version -o /tmp/ccMWYsbr.s' Why is it twice? From gcc@yapost.com Mon Aug 2 09:35:00 2004 From: gcc@yapost.com (GCC) Date: Mon, 02 Aug 2004 09:35:00 -0000 Subject: rebuild gcc driver Message-ID: <410E6C2A.1010403@yapost.com> is there builtin target for that? if i need only the driver functionality, which stage is enough for me? From eljay@adobe.com Mon Aug 2 12:06:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 02 Aug 2004 12:06:00 -0000 Subject: gcc driver behaviour References: <410E4F5C.1090404@yapost.com> Message-ID: <019101c47889$24928010$d3b2f882@PS253> Hi, >Why is it twice? For an explanation of the cc1 parameters, type: cc1 --help HTH, --Eljay From gdr@integrable-solutions.net Mon Aug 2 12:18:00 2004 From: gdr@integrable-solutions.net (Gabriel Dos Reis) Date: Mon, 02 Aug 2004 12:18:00 -0000 Subject: gcc driver behaviour In-Reply-To: <410E4F5C.1090404@yapost.com> References: <410E4F5C.1090404@yapost.com> Message-ID: GCC writes: | when compile like `gcc -c one.c' | find out that cc1 gets arguments like | `-quiet -v one.c -quiet -dumpbase one.c -mtune=pentiumpro -auxbase one | -version -o /tmp/ccMWYsbr.s' | | Why is it twice? What "it"? -- Gaby From kowarz@math.tu-dresden.de Mon Aug 2 12:46:00 2004 From: kowarz@math.tu-dresden.de (Andreas Kowarz) Date: Mon, 02 Aug 2004 12:46:00 -0000 Subject: gcc: speed problem with several g++ versions Message-ID: <410E3788.1080806@math.tu-dresden.de> Hello, we made some interesting experience while implementing and testing a software package, which makes use of overloaded operators. One aspect of the implementation is the speed of the resulting binaries. To find the best solution we have tested the following approaches: normal overloading and templates. The example (attachment) contains the source code for 3 programms: prog - execution without overloading progtemp - template based progover - normal overloading Compiled with g++ version 3.2 we got the following runtime: prog about 2.9 seconds progtemp about 2.9 seconds progover about 3.5 seconds It seems clear that the template based implementation should be the one to use. After recompiling with g++ version 3.4.1 we got a complete different result: prog about 2.9 seconds progtemp about 15.4 seconds !!! progover about 3.5 seconds This time the template version is not really good. :-( (Same problem with g++ version 3.3.2 on a different machine) My questions are: - Is this a known problem? - Is there a compiler switch which can solve the problem? Sincerely yours, Andreas Kowarz -------------- next part -------------- A non-text attachment was scrubbed... Name: example.tar.bz2 Type: application/x-bzip Size: 1704 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: kowarz.vcf Type: text/x-vcard Size: 339 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 256 bytes Desc: OpenPGP digital signature URL: From lrtaylor@micron.com Mon Aug 2 16:32:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Mon, 02 Aug 2004 16:32:00 -0000 Subject: Avoiding libgcc_s.so dependency Message-ID: <363801FFD7B74240A329CEC3F7FE4CC40215DB95@ntxboimbx07.micron.com> You can tell GCC to statically link in libgcc with the -static-libgcc option. However, it sounds like your ssl library was dynamically linked with it, so, so long as you're linking to the libcrypto.so instead of libcrypto.a, you're going to get it's dependencies as well. The only way to can avoid getting its dependencies as well is to either link to the static version, or to relink (i.e., rebuild) libcrypto.so so that it is statically linked to its dependencies. The linker always prefers .so files of .a files if it has a choice. You can tell it to only link to static libraries something like this: gcc -static-libgcc -Wl,-B,static -lfoo -lbar -Wl,-B,dynamic That should work, if you're using the Solaris linker. What will happen is that it will link to libfoo.a and libbar.a. If it can't find either of them (for example, if libfoo.so exists, but not libfoo.a), it will produce an error. The last argument tells the linker to prefer dynamical linking again. That way, you will get shared versions of the system libraries. Does that make sense? Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Stian Oksavik Sent: Sunday, August 01, 2004 6:13 AM To: gcc-help@gcc.gnu.org Subject: Avoiding libgcc_s.so dependency Howdy all, I'm struggling with libgcc_s.so.1. It seems that pretty much any non-trivial program I compile ends up depending on libgcc_s.so.1. Basically, this means that I can't distribute software without also distributing this library, which is problematic for any number of reasons. I've been told to just build static binaries to avoid this problem, but this is not an option on Solaris as Sun does not include all the libraries needed to build static libraries of most software. My goal is to be able to build binaries that avoid dependencies on any third-party libraries, and only depends on Sun's bundled libraries. The current project -- and problem -- is with OpenSSH 3.8.1p1 under Solaris 9/sparc. OpenSSH picks up libcrypto.so.1 from OpenSSL (even though libcrypto.a also exists), and that in turn forces libgcc_s.so.1 into the equation -- no matter what combination of gcc and ld flags I try to keep this from happening. So, two questions: a) What is the purpose of libgcc_s.so.1, and does this purpose outweigh the inconvenience this library causes? (Including one machine we could no longer log into because removing the SMCgcc package from it disabled sshd?) b) Is there ANY way to get rid of this dependency without building a fully static binary? Thanks, -Stian From takenaka@intellilink.co.jp Tue Aug 3 01:19:00 2004 From: takenaka@intellilink.co.jp (Takenaka Kazuhiro) Date: Tue, 03 Aug 2004 01:19:00 -0000 Subject: g++ -fconserve-space makes no effect Message-ID: <410EE84D.5010509@intellilink.co.jp> Hello every one. Can you help me with the following problem. I tried to compile C++ program on Fedra core 1 by g++ 3.3.2 and then compilation was aborted. (The program is first developped on Solaris 8 by Sun compiler.) Source files are like following. <<< main.C #include int var; int main(void) { var = 0; printf("var = %d\n", var); return 0; } >>> end <<< var.C int var; >>> end Commands to compile are following. <<< commands 1. g++ -o main.o -c main.C 2. g++ -o var.o -c var.C 3. g++ -o testprg main.o var.o >>> end Command 3. aborted. messages were following. <<< messages var.o(.bss+0x0): multiple definition of `var' main.o(.bss+0x0): first defined here collect2: ld returned 1 exit status >>> end I looked up option `-fconserve-space' in manual(Node: C++ Dialect Options), so I added Command 1-2 the option. But I got same result. I searched effects of '-fconserve-space' in gcc source files and found following. <<< gcc/cp/decl.c:7825 #if ! defined (ASM_OUTPUT_BSS) && ! defined (ASM_OUTPUT_ALIGNED_BSS) /* Tell the back-end to use or not use .common as appropriate. If we say -fconserve-space, we want this to save .data space, at the expense of wrong semantics. If we say -fno-conserve-space, we want this to produce errors about redefs; to do this we force variables into the data segment. */ DECL_COMMON (tem) = ((TREE_CODE (tem) != VAR_DECL || !DECL_THREAD_LOCAL (tem)) && (flag_conserve_space || ! TREE_PUBLIC (tem))); #endif >>> end I found no definition of ASM_OUTPUT_BSS for i386/linux but found ASM_OUTPUT_ALIGNED_BSS in gcc/config/i386/linux.h at 153. So I commented out the definition and build gcc, then the option makes specified effects. Now, new gcc can compile and link the program. I hava some questions: 1. The behavior of compiler is inconsistent with the manual description. Which is wrong ?. 2. What kind of side effect will be expected with the modification ? 3. Is there any better solution for the problem ? -- Takenaka Kazuhiro From hueffner@informatik.uni-tuebingen.de Tue Aug 3 07:54:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Tue, 03 Aug 2004 07:54:00 -0000 Subject: g++ -fconserve-space makes no effect In-Reply-To: <410EE84D.5010509@intellilink.co.jp> (Takenaka Kazuhiro's message of "Tue, 03 Aug 2004 10:20:13 +0900") References: <410EE84D.5010509@intellilink.co.jp> Message-ID: <87isc064ia.fsf@informatik.uni-tuebingen.de> Takenaka Kazuhiro writes: > Can you help me with the following problem. I tried to compile > C++ program on Fedra core 1 by g++ 3.3.2 and then compilation > was aborted. > > (The program is first developped on Solaris 8 by Sun compiler.) > > Source files are like following. > > <<< main.C > #include > > int var; > > int main(void) > { > var = 0; > printf("var = %d\n", var); > return 0; > } >>>> end > > <<< var.C > int var; >>>> end This is not legal in C++. One of these must be "static" or "external" (depending on whether you want them to be identical or not). -- Falk From ankitjain1580@yahoo.com Tue Aug 3 09:31:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Tue, 03 Aug 2004 09:31:00 -0000 Subject: mmx programming Message-ID: <20040803093154.74924.qmail@web52910.mail.yahoo.com> well if i have loaded the register mm0 with 8, 8 byte values and want to extract just the 5 th byte. how to do that next i want to shift 1 byte to left in a register how to shift 1 complete byte to left thanks ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From marcelo@jct.ac.il Tue Aug 3 11:01:00 2004 From: marcelo@jct.ac.il (Marcelo Roitburd) Date: Tue, 03 Aug 2004 11:01:00 -0000 Subject: evaluation of memory In-Reply-To: Message-ID: Hi, Anyone know how i can evaluation ho much memory each function take. memprof give me the real-time , the question it's it have a some function that tell me like sizeof for function ... and if have a sizeof to callss that i creat. thank you Marcelo From fcusack@fcusack.com Tue Aug 3 11:23:00 2004 From: fcusack@fcusack.com (Frank Cusack) Date: Tue, 03 Aug 2004 11:23:00 -0000 Subject: -Wl conversion in "specs" file Message-ID: <20040803042343.A15899@google.com> The *link directive in my gcc-3.4.0 specs file contains '%{Wl,*:%*}' which says to strip the -Wl, part of the arg and pass the rest to the linker. However, removal of this directive has no effect: -Wl, arguments are still passed on correctly to the linker. Is this conversion now implicit and not handled by specs? (It seems so.) If so, shouldn't this be removed from the specs file? I'd rather see it used, but at least removal doesn't give the false impression that this directive is honored. I wanted to transfrom -Wl,-rpath to -Wl,-R so that broken Makefiles which use the GNU-only -rpath will work with the Solaris linker which only accepts -R. I discovered this problem by changing the directive to '%{Wl,-rpath:-R} %{Wl,*:%*}' which had no effect. (And then I further found that removing it entirely has no effect.) I've verified with gcc -v that I'm playing with the correct specs file. thx /fc From gcc@yapost.com Tue Aug 3 12:04:00 2004 From: gcc@yapost.com (GCC) Date: Tue, 03 Aug 2004 12:04:00 -0000 Subject: how many spec files Message-ID: <410FE080.6050603@yapost.com> how many spec files using gcc driver? From kasparfischer@gmx.net Tue Aug 3 13:17:00 2004 From: kasparfischer@gmx.net (Kaspar Fischer) Date: Tue, 03 Aug 2004 13:17:00 -0000 Subject: Problem compiling GCC 3.4.1 on sparc-sun-solaris2.9 Message-ID: <5616.1091539070@www53.gmx.net> Hi all, I am trying to compile GCC 3.4.1 on sparc-sun-solaris2.9 (SunOS 5.9). Here's what I do: cd tmp tar zxf gcc-core-3.4.1.tar.gz tar zxf gcc-g++-3.4.1.tar.gz mkdir objdir cd objdir /home/fischerk/tmp/gcc-3.4.1/configure --enable-languages=c++ --prefix=/ home/fischerk/pub/gcc-3.4.1 make bootstrap The system compiler (the one I use to build GCC) has the following version: bash-2.05$ echo $CC bash-2.05$ gcc --version 2.95.3 And as you can see, I am using bash. The problem I encounter is the following: Somewhen (I guess, before even starting with stage 1), I get an error looking as follows: mv *.o insn-flags.h insn-config.h insn-codes.h insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c insn-attr.h insn-attrtab.c insn- opinit.c insn-constants.h tm-preds.h tree-check.h insn-conditions.c min- insn-modes.c insn-modes.c insn-modes.h s-flags s-config s-codes s-mlib s- genrtl s-modes s-gtype gtyp-gen.h s-output s-recog s-emit s-extract s-peep s-check s-conditions s-attr s-attrtab s-opinit s-preds s-constants s-crt0 genemit genoutput genrecog genextract genflags gencodes genconfig genpeep genattrtab genattr genopinit gengenrtl gencheck genpreds genconstants gengtype genconditions genmodes genrtl.c genrtl.h gt-*.h gtype-*.h gtype- desc.c xgcc cpp cc1 crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o crtfastmath.o gcc-cross protoize unprotoize specs collect2 collect2 gcov-iov gcov gcov-dump *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk g++ g++-cross cc1plus stage1 mv: cannot access s-crt0 mv: cannot access crt1.o mv: cannot access crti.o mv: cannot access crtn.o mv: cannot access gcrt1.o mv: cannot access gmon.o mv: cannot access crtbegin.o mv: cannot access crtend.o mv: cannot access crtfastmath.o mv: cannot access gcc-cross mv: cannot access protoize mv: cannot access unprotoize mv: cannot access specs mv: cannot access collect2 mv: cannot access gcov mv: cannot access gcov-dump mv: cannot access *.[0-9][0-9].* mv: cannot access *.[si] mv: cannot access g++-cross mv: cannot access cc1plus make[2]: [stage1-start] Error 2 (ignored) Does anybody know what the problem might be? I would very much appreciate any help because I tried lots of options (--disable-multilib, etc.) without any success. Regards, Kaspar -- NEU: WLAN-Router f??r 0,- EUR* - auch f??r DSL-Wechsler! GMX DSL = superg??nstig & kabellos http://www.gmx.net/de/go/dsl From daniel.franke@imbs.uni-luebeck.de Tue Aug 3 15:55:00 2004 From: daniel.franke@imbs.uni-luebeck.de (Daniel Franke) Date: Tue, 03 Aug 2004 15:55:00 -0000 Subject: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)? Message-ID: <200408031746.13962.daniel.franke@imbs.uni-luebeck.de> Hi all, I try to figure out how to compile the code below as 64bit executable: -- foo.cpp -- int main () { return 0; } -- The code compiles: $> g++ -m64 -O2 -g foo.cpp and: $> file a.out a.out: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped tells me that I got what I asked for, but: $> ldd a.out libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 - wrong ELF class: ELFCLASS32 libm.so.1 => /usr/lib/64/libm.so.1 libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 - wrong ELF class: ELFCLASS32 libc.so.1 => /usr/lib/64/libc.so.1 libdl.so.1 => /usr/lib/64/libdl.so.1 /usr/platform/SUNW,Sun-Blade-1000/lib/sparcv9/libc_psr.so.1 As you can see, the linker (sun ld) seems to include the 32bit versions of libstd++ and libgcc_s, instead of their 64bit companions - which are located in '/usr/local/lib/sparcv9/'. Verbose output (see below) shows that -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 actually _is_ included in the library search path. What's wrong here? Do I miss something? Compiler flags? Linker flags? A bug in g++/collect2? Something completely different? Thanks in advance for any hints :) Daniel Franke $> g++ -v -m64 -O2 -g foo.cpp Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/cc1plus -quiet -v -D__arch64__ -D__sparcv9 foo.cpp -mptr64 -mstack-bias -mno-v8plus -quiet -dumpbase foo.cpp -m64 -mcpu=v7 -auxbase foo -g -O2 -version -o /var/tmp//ccKbcjqe.s ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../sparc-sun-solaris2.8/include" #include "..." search starts here: #include <...> search starts here: /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/sparc-sun-solaris2.8 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/backward /usr/local/include /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/include /usr/include End of search list. GNU C++ version 3.4.1 (sparc-sun-solaris2.8) compiled by GNU C version 3.4.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 /usr/ccs/bin/as -V -Qy -s -xarch=v9 -o /var/tmp//ccK2DZnn.o /var/tmp//ccKbcjqe.s /usr/ccs/bin/as: Sun WorkShop 6 99/08/18 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/collect2 -V -Y P,/usr/lib/sparcv9 -Qy /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crt1.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crti.o /usr/ccs/lib/sparcv9/values-Xa.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtbegin.o -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1 -L/usr/ccs/bin/sparcv9 -L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 -L/usr/ccs/lib -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../.. -L/lib/sparcv9 -L/usr/lib/sparcv9 /var/tmp//ccK2DZnn.o -lstdc++ -lm -lgcc_s_sparcv9 -lgcc -lc -lgcc_s_sparcv9 -lgcc -lc /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtend.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtn.o ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.284 $> g++ -v reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 $> g++ -print-multi-lib .; sparcv9;@m64 -- Dipl.-Math. (FH) Daniel Franke Institut fuer Medizinische Biometrie und Statistik Medizinische Universit?t zu Luebeck Ratzeburger Allee 160, Haus 4 23538 Luebeck Telefon: 0451-500-2786 Telefax: 0451-500-2999 daniel.franke@imbs.uni-luebeck.de From wadedl@gat.com Tue Aug 3 16:07:00 2004 From: wadedl@gat.com (wadedl@gat.com) Date: Tue, 03 Aug 2004 16:07:00 -0000 Subject: gcc-3.2 Solaris 8 sun4u Enterprise 450 build/config info Message-ID: <0I1V05I03OQ98B@gat.com> Dear gcc-help: I built gcc-3.2 under Solaris 8 with some difficulty until I found the right configuration options. I thought my build info might help anyone else trying to do this: Sun architecture: sun4u ( Enterprise 450 ) Solaris 8 2/02 patched 8_Recommended and J2SE_Solaris_8_Recommended, installed with 64 bit support. pkgadd'ed into /usr/local: SMCgzip (sparc) 1.2.4a SMCmake (sparc) 3.79.1 SMCbison (sparc) 1.28 SMCflex (sparc) 2.5.4a SMCbinut (sparc) 2.11.2 SMCgcc (sparc) 3.2 PATH=/usr/local/bin:/usr/sbin:/usr/bin LD_LIBRARY_PATH=/usr/local/lib ../gcc-3.2/configure -prefix=/usr/local/gnu \ -exec-prefix=/usr/local/gnu \ --with-gnu-ld \ --with-gnu-as \ --with-as=/usr/local/bin/as \ --with-ld=/usr/local/bin/ld \ --enable-shared Yours, David L. Wade ********************************************************************** David L. Wade EMail: David.Wade@gat.com Senior Systems Programmer Analyst Ph. 858-455-3342 General Atomics Fx. 858-455-2692 3550 General Atomics Court San Diego, California 92121 ********************************************************************** opinions, conclusions, or recommendations expressed above are my own and do not necessarily represent the views of my employer. From ssarnald@gmail.com Tue Aug 3 16:07:00 2004 From: ssarnald@gmail.com (Arnald Samthambi) Date: Tue, 03 Aug 2004 16:07:00 -0000 Subject: Support for Thumb PLT entries Message-ID: <94420f6d04080309074bb39884@mail.gmail.com> Hi, I am not quite sure whether this question belongs on the list but I'll start here. Answers and or referrals to other lists are hoped for. I am trying to create shared library using arm-elf-gcc for THUMB (using option -mthumb). It seems to me that the arm-elf-ld does not generate PLT entries for extern functions, however it generates GOT entries. I am able to see the PLT and GOT entries in ARM mode. I am using: Binutils - 2.14 Gcc - 4.4.1 Is it a known problem in GCC or am I missing anything? >From the link http://sources.redhat.com/ml/binutils/2002-07/msg00578.html I understand that the issues is known and fixed, am I making sense here? Thanks in advance Arnald From lrtaylor@micron.com Tue Aug 3 16:25:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Tue, 03 Aug 2004 16:25:00 -0000 Subject: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)? Message-ID: <363801FFD7B74240A329CEC3F7FE4CC403096036@ntxboimbx07.micron.com> GCC's 64-bit libraries are in a different directory. For example, try looking under /usr/local/lib for a directory named sparcv9 or something. Or, if GCC's libraries are installed into a GCC-specific sub directory somewhere, try looking there. You'll then need to modify your LD_LIBRARY_PATH to look there before /usr/local/lib. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Daniel Franke Sent: Tuesday, August 03, 2004 9:46 AM To: gcc-help@gcc.gnu.org Subject: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)? Hi all, I try to figure out how to compile the code below as 64bit executable: -- foo.cpp -- int main () { return 0; } -- The code compiles: $> g++ -m64 -O2 -g foo.cpp and: $> file a.out a.out: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped tells me that I got what I asked for, but: $> ldd a.out libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 - wrong ELF class: ELFCLASS32 libm.so.1 => /usr/lib/64/libm.so.1 libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 - wrong ELF class: ELFCLASS32 libc.so.1 => /usr/lib/64/libc.so.1 libdl.so.1 => /usr/lib/64/libdl.so.1 /usr/platform/SUNW,Sun-Blade-1000/lib/sparcv9/libc_psr.so.1 As you can see, the linker (sun ld) seems to include the 32bit versions of libstd++ and libgcc_s, instead of their 64bit companions - which are located in '/usr/local/lib/sparcv9/'. Verbose output (see below) shows that -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 actually _is_ included in the library search path. What's wrong here? Do I miss something? Compiler flags? Linker flags? A bug in g++/collect2? Something completely different? Thanks in advance for any hints :) Daniel Franke $> g++ -v -m64 -O2 -g foo.cpp Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/cc1plus -quiet -v -D__arch64__ -D__sparcv9 foo.cpp -mptr64 -mstack-bias -mno-v8plus -quiet -dumpbase foo.cpp -m64 -mcpu=v7 -auxbase foo -g -O2 -version -o /var/tmp//ccKbcjqe.s ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../sparc-sun-solaris2.8/include" #include "..." search starts here: #include <...> search starts here: /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/sparc-sun-solaris2.8 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../../include/c++/3.4.1/backward /usr/local/include /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/include /usr/include End of search list. GNU C++ version 3.4.1 (sparc-sun-solaris2.8) compiled by GNU C version 3.4.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 /usr/ccs/bin/as -V -Qy -s -xarch=v9 -o /var/tmp//ccK2DZnn.o /var/tmp//ccKbcjqe.s /usr/ccs/bin/as: Sun WorkShop 6 99/08/18 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.1/collect2 -V -Y P,/usr/lib/sparcv9 -Qy /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crt1.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crti.o /usr/ccs/lib/sparcv9/values-Xa.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtbegin.o -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1 -L/usr/ccs/bin/sparcv9 -L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 -L/usr/ccs/lib -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../../sparcv9 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/../../.. -L/lib/sparcv9 -L/usr/lib/sparcv9 /var/tmp//ccK2DZnn.o -lstdc++ -lm -lgcc_s_sparcv9 -lgcc -lc -lgcc_s_sparcv9 -lgcc -lc /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtend.o /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/sparcv9/crtn.o ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.284 $> g++ -v reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.4.1 $> g++ -print-multi-lib .; sparcv9;@m64 -- Dipl.-Math. (FH) Daniel Franke Institut fuer Medizinische Biometrie und Statistik Medizinische Universit?t zu Luebeck Ratzeburger Allee 160, Haus 4 23538 Luebeck Telefon: 0451-500-2786 Telefax: 0451-500-2999 daniel.franke@imbs.uni-luebeck.de From daniel.franke@imbs.uni-luebeck.de Tue Aug 3 16:41:00 2004 From: daniel.franke@imbs.uni-luebeck.de (Daniel Franke) Date: Tue, 03 Aug 2004 16:41:00 -0000 Subject: sparc-sun-solaris2.8-g++: collect-ing wrong libraries (32/64 bit)? In-Reply-To: <363801FFD7B74240A329CEC3F7FE4CC403096036@ntxboimbx07.micron.com> References: <363801FFD7B74240A329CEC3F7FE4CC403096036@ntxboimbx07.micron.com> Message-ID: <200408031832.08846.daniel.franke@imbs.uni-luebeck.de> Am Dienstag, 3. August 2004 18:24 schrieb lrtaylor@micron.com: > GCC's 64-bit libraries are in a different directory. For example, try > looking under /usr/local/lib for a directory named sparcv9 or something. > Or, if GCC's libraries are installed into a GCC-specific sub directory > somewhere, try looking there. You'll then need to modify your > LD_LIBRARY_PATH to look there before /usr/local/lib. > > Thanks, > Lyle Oh my goddess! Lyle, thank you very much. I hadn't had '/usr/local/lib/sparcv9' in my LD_LIBRARY_PATH. I somehow thought the libs should be found anyway (magic?). I knew it must be something really stupid! Thanks a lot! Daniel -- Dipl.-Math. (FH) Daniel Franke Institut fuer Medizinische Biometrie und Statistik Medizinische Universit?t zu Luebeck Ratzeburger Allee 160, Haus 4 23538 Luebeck Telefon: 0451-500-2786 Telefax: 0451-500-2999 daniel.franke@imbs.uni-luebeck.de From kasparfischer@gmx.net Tue Aug 3 18:46:00 2004 From: kasparfischer@gmx.net (Kaspar Fischer) Date: Tue, 03 Aug 2004 18:46:00 -0000 Subject: Problem compiling GCC 3.4.1 on sparc-sun-solaris2.9 Message-ID: <708.1091558812@www38.gmx.net> After having reread the architecture-specific configuration documentation, I also tried CC="cc -xildoff -xarch=v9" /home/fischerk/tmp/gcc-3.4.1/configure --prefix=/home/fischerk/pub/gcc -3.4.1 --enable-shared --enable-languages=c++ make bootstrap and CC="cc -xildoff -xarch=v9" /home/fischerk/tmp/gcc-3.4.1/configure --prefix=/home/fischerk/pub/gcc -3.4.1 --enable-shared --enable-languages=c++ --with-as=/usr/ccs/bin/as -- with-ld=/usr/ccs/bin/ld make bootstrap Both attempts failed again. Has anybody had similar difficulties? Many thanks, Kaspar -- NEU: WLAN-Router f??r 0,- EUR* - auch f??r DSL-Wechsler! GMX DSL = superg??nstig & kabellos http://www.gmx.net/de/go/dsl From Vernon.Sauder@spirentcom.com Wed Aug 4 00:27:00 2004 From: Vernon.Sauder@spirentcom.com (Sauder, Vernon) Date: Wed, 04 Aug 2004 00:27:00 -0000 Subject: Designated Initialization in g++ Message-ID: <136BC61723D0D711A22000B0D068A97D012A8BD9@minotaur.hekimian.com> When is support for Designated Initialization per C99 expected to be implemented in g++? Is the current aggregate initialization support to be deprecated at that time? Example: struct flock f = { l_type: F_UNLCK, l_len: 0 }; << currently supported struct flock f = { .l_type = F_UNLCK, .l_len = 0 }; << C99 Vernon Sauder Office: +1 301.417.1798 Mobile: +1 240.994.2226 Email: Vernon.Sauder@spirentcom.com From Matthew.Thyer@dsto.defence.gov.au Wed Aug 4 06:39:00 2004 From: Matthew.Thyer@dsto.defence.gov.au (Thyer, Matthew) Date: Wed, 04 Aug 2004 06:39:00 -0000 Subject: Help: Unable to achieve satisfactory outcome from test suite for GCC 3.4.1 on Solaris 8 Message-ID: I can build GCC with "make bootstrap" however I am unable to get good results from the test suite. Using the method documented in this e-mail, I am getting this from the test suite: % egrep '==|^#' ../make_check.log | grep -v "tests ===" === gcc Summary === # of expected passes 24948 # of unexpected successes 1 # of expected failures 72 # of unresolved testcases 5 # of untested testcases 7 # of unsupported tests 312 === g++ Summary === # of expected passes 8419 # of unexpected failures 1117 # of expected failures 71 # of unresolved testcases 14 # of unsupported tests 67 === g77 Summary === # of expected passes 1115 # of unexpected failures 617 # of unresolved testcases 14 # of unsupported tests 6 === objc Summary === # of expected passes 822 # of unexpected failures 530 # of unsupported tests 8 === libstdc++ Summary === # of expected passes 1409 # of unexpected failures 1287 # of expected failures 6 === libffi Summary === # of expected passes 77 # of unexpected failures 77 # of unsupported tests 2 === libjava Summary === # of expected passes 1486 # of unexpected failures 900 # of expected failures 5 # of untested testcases 907 =================== =================== When I compare this with "http://gcc.gnu.org/ml/gcc-testresults/2004-07/msg00258.html" I see that I have passed the first set of tests pretty well (those summarised under "gcc Summary") however all the other tests fail a lot more than expected. The methodology I used to build and test the software is as follows: Log on to "Server" after ensuring that your ~/.cshrc is similar to the attached file to ensure a clean environment. Download the source archive for GCC 3.4.1 from the following location: ftp://mirror.aarnet.edu.au/pub/gcc/releases/gcc-3.4.1/gcc-3.4.1.tar.bz2 Download binary packages for GCC version 2.95.3 and gmake 3.79.1 which have been built for a prefix other than /usr/local (to not interfere with users). Binaries built for prefix /opt/sfw are available from: "Solaris 8 2/02 Companion Software individual packages download" at: "http://wwws.sun.com/software/solaris/freeware/pkgs_download.html". These packages also require "gcmn-1.0-pkg.zip" which is available from the same location. Put the downloaded archives "gcc-3.4.1.tar.bz2", "gcc-2.95.3-pkg.zip", "gmake-3.79.1-pkg.zip" and "gcmn-1.0-pkg.zip" in your home directory. Run the following build script (as yourself not root but remember to prep your sudo first): #!/bin/sh # Make a temporary directory and change to it TMP_BASE=/var/tmp/$USER mkdir -p ${TMP_BASE}/SCIS_Change_$$ cd ${TMP_BASE}/SCIS_Change_$$ # Unpack the GCC source archive using GNU tar bzcat $HOME/gcc-3.4.1.tar.bz2 | /usr/local/bin/tar -xf - # Unpack and install the binary packages (those prefixed with /opt/sfw) unzip $HOME/gcmn-1.0-pkg.zip unzip $HOME/gcc-2.95.3-pkg.zip unzip $HOME/gmake-3.79.1-pkg.zip sudo /usr/sbin/pkgadd -n -d SFWgcmn all sudo /usr/sbin/pkgadd -n -d SFWgcc all sudo /usr/sbin/pkgadd -n -d SFWgmake all # Now configure GCC # Set necessary environment variables CC=/opt/sfw/bin/gcc CONFIG_SHELL=/bin/ksh export CC CONFIG_SHELL # Configure in a separate build directory mkdir objdir cd objdir ${TMP_BASE}/SCIS_Change_$$/gcc-3.4.1/configure --with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld --with-ld=/usr/local/bin/ld --with-tune=ultrasparc --enable-languages=c,c++,f77,java,objc --disable-nls >../configure.log 2>&1 # Build using the binary GNU make I installed earlier /opt/sfw/bin/gmake bootstrap >../make_bootstrap.log 2>&1 When the build script completes, the software needs to be tested in accordance with the testing plan which is included below: In order to complete testing, additional software being "DejaGnu 1.4.1 or 1.4.3 or later" is required. The source code for "DejaGnu 1.4.3" can be obtained from: "ftp://mirror.aarnet.edu.au/pub/gnu/dejagnu/dejagnu-1.4.3.tar.gz". This downloaded archive should be placed in your home directory. DejaGnu 1.4.3 requires Expect which requires Tk which requires Tcl. All of this software will need to be installed under a prefix which is not being used by clients. Expect, Tk and Tcl are all available prebuilt for the prefix "/opt/sfw" from: "Solaris 8 2/02 Companion Software individual packages download" at: "http://wwws.sun.com/software/solaris/freeware/pkgs_download.html". The files to be downloaded are: "expect-5.31-pkg.zip", "Tk-8.3.3-pkg.zip" and "Tcl-8.3.3-pkg.zip". Install the dependencies for "DejaGnu 1.4.3" first as follows: Log on to "Server" after ensuring that your ~/.cshrc is similar to the attached file to ensure a clean environment. % cd /var/tmp/$USER % unzip $HOME/Tcl-8.3.3-pkg.zip % unzip $HOME/Tk-8.3.3-pkg.zip % unzip $HOME/expect-5.31-pkg.zip % sudo /usr/sbin/pkgadd -n -d SFWtcl all % sudo /usr/sbin/pkgadd -n -d SFWtk all % sudo /usr/sbin/pkgadd -n -d SFWexpct all Then build and install "DejaGnu 1.4.3" as follows: Unpack the source archive for "DejaGnu 1.4.3" as follows: % rehash % gzcat ~/dejagnu-1.4.3.tar.gz | tar -xf - % mkdir dejagnu-objdir % cd dejagnu-objdir % setenv CC /opt/sfw/bin/gcc % /var/tmp/$USER/dejagnu-1.4.3/configure --srcdir=/var/tmp/$USER/dejagnu-1.4.3 --prefix=/opt/SCIS sparc-sun-solaris2 % /opt/sfw/bin/gmake CC=$CC % sudo /opt/sfw/bin/gmake install Now run the GCC 3.4.1 test suite as follows (NOTE the number "18746" will need to be substituted with whatever your directory is as a result of the Build phase): % rehash % cd /var/tmp/$USER/SCIS_Change_18746/objdir % sudo /opt/sfw/bin/gmake -k check >& ../make_check.log When the test suite has completed, run the following command to summarise the test results: % egrep '==|^#' ../make_check.log | grep -v "tests ===" Compare the output with the result published at "http://gcc.gnu.org/ml/gcc-testresults/2004-07/msg00258.html". Can anyone explain why I get these results? Would it help to install the compiler and then use itself to build itself? From gcc@yapost.com Wed Aug 4 07:44:00 2004 From: gcc@yapost.com (GCC) Date: Wed, 04 Aug 2004 07:44:00 -0000 Subject: add external compiler Message-ID: <4110F50E.7030802@yapost.com> I want to add external compiler for gcc driver. Till now just did cc1 like link to my compiler and change cc1_options. Is there better way to proceed? From gcc@yapost.com Wed Aug 4 07:50:00 2004 From: gcc@yapost.com (GCC) Date: Wed, 04 Aug 2004 07:50:00 -0000 Subject: gcc driver behaviour In-Reply-To: References: <410E4F5C.1090404@yapost.com> Message-ID: <4110F67D.20303@yapost.com> Gabriel Dos Reis wrote: >GCC writes: > >| when compile like `gcc -c one.c' >| find out that cc1 gets arguments like >| `-quiet -v one.c -quiet -dumpbase one.c -mtune=pentiumpro -auxbase one >| -version -o /tmp/ccMWYsbr.s' >| >| Why is it twice? > >What "it"? > >-- Gaby > > > > `-quiet' From alexvn@connect.to Wed Aug 4 08:57:00 2004 From: alexvn@connect.to (Alex Vinokur) Date: Wed, 04 Aug 2004 08:57:00 -0000 Subject: speed problem with several g++ versions References: <410E3788.1080806@math.tu-dresden.de> Message-ID: "Andreas Kowarz" wrote in message news:410E3788.1080806@math.tu-dresden.de... > > Hello, > > we made some interesting experience while implementing and testing a software > package, which makes use of overloaded operators. One aspect of the > implementation is the speed of the resulting binaries. To find the best solution > we have tested the following approaches: normal overloading and templates. The > example (attachment) contains the source code for 3 programms: > > prog - execution without overloading > progtemp - template based > progover - normal overloading > > Compiled with g++ version 3.2 we got the following runtime: > prog about 2.9 seconds > progtemp about 2.9 seconds > progover about 3.5 seconds > It seems clear that the template based implementation should be the one to use. > > After recompiling with g++ version 3.4.1 we got a complete different result: > prog about 2.9 seconds > progtemp about 15.4 seconds !!! > progover about 3.5 seconds > This time the template version is not really good. :-( > (Same problem with g++ version 3.3.2 on a different machine) > > My questions are: > - Is this a known problem? > - Is there a compiler switch which can solve the problem? > > Sincerely yours, > > Andreas Kowarz > tar (GNU tar) 1.13.25 doesn't extract files from example.tar which contains tested sources. -- Alex Vinokur http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn From hueffner@informatik.uni-tuebingen.de Wed Aug 4 09:12:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Wed, 04 Aug 2004 09:12:00 -0000 Subject: gcc: speed problem with several g++ versions In-Reply-To: <410E3788.1080806@math.tu-dresden.de> (Andreas Kowarz's message of "Mon, 02 Aug 2004 14:46:00 +0200") References: <410E3788.1080806@math.tu-dresden.de> Message-ID: <87657zi7x7.fsf@informatik.uni-tuebingen.de> Andreas Kowarz writes: > we made some interesting experience while implementing and testing a > software package, which makes use of overloaded operators. One aspect > of the implementation is the speed of the resulting binaries. To find > the best solution we have tested the following approaches: normal > overloading and templates. The example (attachment) contains the > source code for 3 programms: > > prog - execution without overloading > progtemp - template based > progover - normal overloading > > Compiled with g++ version 3.2 we got the following runtime: > prog about 2.9 seconds > progtemp about 2.9 seconds > progover about 3.5 seconds > It seems clear that the template based implementation should be the one to use. > > After recompiling with g++ version 3.4.1 we got a complete different result: > prog about 2.9 seconds > progtemp about 15.4 seconds !!! > progover about 3.5 seconds > This time the template version is not really good. :-( > (Same problem with g++ version 3.3.2 on a different machine) > > My questions are: > - Is this a known problem? > - Is there a compiler switch which can solve the problem? This seems to be something target specific; on Alpha, I get the exact same time for all three programs with both 3.3 and 3.4. I guess one would have to look at the assembly to see what causes it... might be register allocation or inlining. You could try changing inline settings and -fomit-frame-pointer and -fnew-ra. -- Falk From alexvn@connect.to Wed Aug 4 09:22:00 2004 From: alexvn@connect.to (Alex Vinokur) Date: Wed, 04 Aug 2004 09:22:00 -0000 Subject: gcc: speed problem with several g++ versions References: <410E3788.1080806@math.tu-dresden.de> <87657zi7x7.fsf@informatik.uni-tuebingen.de> Message-ID: "Falk Hueffner" wrote in message news:87657zi7x7.fsf@informatik.uni-tuebingen.de... [snip] > This seems to be something target specific; [snip] Yes, performance of the same compiler on different targets is quite different. See, for instance: http://article.gmane.org/gmane.comp.lang.c%2B%2B.perfometer/37 http://groups.google.com/groups?selm=biihim%249opf4%241%40ID-79865.news.uni-berlin.de -- Alex Vinokur http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn From frostflare@bol.com.br Wed Aug 4 14:25:00 2004 From: frostflare@bol.com.br (frostflare) Date: Wed, 04 Aug 2004 14:25:00 -0000 Subject: arm-elf-gcc __irq Message-ID: Hi, I want to know how use __irq (interruption) at arm-elf- gcc to ARM7TDMI, i try to compile a C program with this parameter (__irq) and it say "parse error". Please can somebody help me or tell me about how i fix it. Wellington Brazil __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From kowarz@math.tu-dresden.de Wed Aug 4 14:32:00 2004 From: kowarz@math.tu-dresden.de (Andreas Kowarz) Date: Wed, 04 Aug 2004 14:32:00 -0000 Subject: gcc: speed problem with several g++ versions In-Reply-To: <87657zi7x7.fsf@informatik.uni-tuebingen.de> References: <410E3788.1080806@math.tu-dresden.de> <87657zi7x7.fsf@informatik.uni-tuebingen.de> Message-ID: <4110F385.2020705@math.tu-dresden.de> Hi, thank you for the quick response and your suggestions. According to platform dependent results: We have testes the old example on a Pentium3 700 MHz and on an Athlon-XP 1666 MHz. The problem with the template version occurred for both machines. However, we have a new example which leads to much more interesting results on these machines by using gcc332 and gcc341, respectively. The new example contains some overloaded basic operators, which can be used for very simple derivative calculations. The interesting observations concern the runtime, again. On the Pentium3 the function evaluation (prog) needs more than twice the time than calculating function AND derivative (progover). (Somebody should wake me up :-) ). The difference on the Athlon-XP is not that high but has the same (unbelievable) signature. By the way: We will not optimize our code for a specific compiler and version since we do not know, which compiler our users will apply. But we seem to have a good point for discussion about speed, now. I hope this information is useful for gcc development. Sincerely yours, Andreas Kowarz ================================================================================ Falk Hueffner wrote: > Andreas Kowarz writes: > > >>we made some interesting experience while implementing and testing a >>software package, which makes use of overloaded operators. One aspect >>of the implementation is the speed of the resulting binaries. To find >>the best solution we have tested the following approaches: normal >>overloading and templates. The example (attachment) contains the >>source code for 3 programms: >> >>prog - execution without overloading >>progtemp - template based >>progover - normal overloading >> >>Compiled with g++ version 3.2 we got the following runtime: >>prog about 2.9 seconds >>progtemp about 2.9 seconds >>progover about 3.5 seconds >>It seems clear that the template based implementation should be the one to use. >> >>After recompiling with g++ version 3.4.1 we got a complete different result: >>prog about 2.9 seconds >>progtemp about 15.4 seconds !!! >>progover about 3.5 seconds >>This time the template version is not really good. :-( >>(Same problem with g++ version 3.3.2 on a different machine) >> >>My questions are: >>- Is this a known problem? >>- Is there a compiler switch which can solve the problem? > > > This seems to be something target specific; on Alpha, I get the exact > same time for all three programs with both 3.3 and 3.4. I guess one > would have to look at the assembly to see what causes it... might be > register allocation or inlining. You could try changing inline > settings and -fomit-frame-pointer and -fnew-ra. > -------------- next part -------------- A non-text attachment was scrubbed... Name: template_example_3.tar.bz2 Type: application/x-bzip Size: 2375 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: kowarz.vcf Type: text/x-vcard Size: 339 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 256 bytes Desc: OpenPGP digital signature URL: From mldb@gmx.net Wed Aug 4 15:31:00 2004 From: mldb@gmx.net (Marco Manfredini) Date: Wed, 04 Aug 2004 15:31:00 -0000 Subject: gcc: speed problem with several g++ versions In-Reply-To: <4110F385.2020705@math.tu-dresden.de> References: <410E3788.1080806@math.tu-dresden.de> <87657zi7x7.fsf@informatik.uni-tuebingen.de> <4110F385.2020705@math.tu-dresden.de> Message-ID: <200408041726.34586.mldb@gmx.net> On Wednesday 04 August 2004 16:32, Andreas Kowarz wrote: > According to platform dependent results: > We have testes the old example on a Pentium3 700 MHz and on an Athlon-XP > 1666 MHz. The problem with the template version occurred for both machines. Hmm. Did you try marking you template functions inline? template functions aren't neccesarily inlined _automatically_ with all versions of gcc. I've got this: progtemp without inline 10.9 sec. Then I tagged the _declarations_ inline: template class adouble { public: inline adouble(); inline adouble(const T v); inline adouble(const T v1, const T v2); inline void operator = (const T v); inline void operator = (const adouble& v); etc... An I've got: progtemp with inline 0.7 sec. Greetings Marco From milindc@telesoftnet.com Wed Aug 4 15:43:00 2004 From: milindc@telesoftnet.com (Milind Changire) Date: Wed, 04 Aug 2004 15:43:00 -0000 Subject: __attribute__((packed)) behavior with gcc and g++ [gcc version 3.2 20020903] Message-ID: <1091634515.9797.49.camel@mitelLinux> Following peice of code compiles under gcc and reports the size of struct as 11, as expected. However g++ just does not like the code and reports an error 'semicolon missing after enum declaration' g++ 3.4.1 reports a 'warning: `packed' attribute ignored' and I get the size of struct as 14. I'd like to pack structures and cause enums to use mininum possible space, mostly a single byte, under gcc 3.2. Arch: i686 ------ #include #pragma pack(1) typedef enum { Red, Green, Blue } __attribute__((packed)) MYENUM; struct pragma_struct_t { char ch; int val; char ch2; long len; MYENUM color; }; #pragma pack(0) int main() { printf("sizeof(struct pragma_struct_t)= %d\n", sizeof(struct pragma_struct_t)); return 0; } ------ How do I get this to work under g++ 3.2? Any patches or suggestions? -Milind From milindc@telesoftnet.com Wed Aug 4 15:58:00 2004 From: milindc@telesoftnet.com (Milind Changire) Date: Wed, 04 Aug 2004 15:58:00 -0000 Subject: __attribute__((packed)) behavior with gcc and g++ [gcc version 3.2 20020903] Message-ID: <1091634515.9797.49.camel@mitelLinux> Following peice of code compiles under gcc and reports the size of struct as 11, as expected. However g++ just does not like the code and reports an error 'semicolon missing after enum declaration' g++ 3.4.1 reports a 'warning: `packed' attribute ignored' and I get the size of struct as 14. I'd like to pack structures and cause enums to use mininum possible space, mostly a single byte, under gcc 3.2. Arch: i686 ------ #include #pragma pack(1) typedef enum { Red, Green, Blue } __attribute__((packed)) MYENUM; struct pragma_struct_t { char ch; int val; char ch2; long len; MYENUM color; }; #pragma pack(0) int main() { printf("sizeof(struct pragma_struct_t)= %d\n", sizeof(struct pragma_struct_t)); return 0; } ------ How do I get this to work under g++ 3.2? Any patches or suggestions? -Milind From milindc@telesoftnet.com Wed Aug 4 16:52:00 2004 From: milindc@telesoftnet.com (Milind Changire) Date: Wed, 04 Aug 2004 16:52:00 -0000 Subject: __attribute__((packed)) behavior with gcc and g++ [gcc version 3.2 20020903] Message-ID: <1091634515.9797.49.camel@mitelLinux> Following peice of code compiles under gcc and reports the size of struct as 11, as expected. However g++ just does not like the code and reports an error 'semicolon missing after enum declaration' g++ 3.4.1 reports a 'warning: `packed' attribute ignored' and I get the size of struct as 14. I'd like to pack structures and cause enums to use mininum possible space, mostly a single byte, under gcc 3.2. Arch: i686 ------ #include #pragma pack(1) typedef enum { Red, Green, Blue } __attribute__((packed)) MYENUM; struct pragma_struct_t { char ch; int val; char ch2; long len; MYENUM color; }; #pragma pack(0) int main() { printf("sizeof(struct pragma_struct_t)= %d\n", sizeof(struct pragma_struct_t)); return 0; } ------ How do I get this to work under g++ 3.2? Any patches or suggestions? -Milind From pluto@pld-linux.org Wed Aug 4 18:52:00 2004 From: pluto@pld-linux.org (=?iso-8859-2?q?Pawe=B3_Sikora?=) Date: Wed, 04 Aug 2004 18:52:00 -0000 Subject: __attribute__((packed)) behavior with gcc and g++ [gcc version 3.2 20020903] In-Reply-To: <1091634515.9797.49.camel@mitelLinux> References: <1091634515.9797.49.camel@mitelLinux> Message-ID: <200408041758.36449.pluto@pld-linux.org> On Wednesday 04 of August 2004 17:48, Milind Changire wrote: > Any patches or suggestions? # g++ --version; g++ packed.cpp -o packed && ./packed g++ (GCC) 3.4.2 20040730 (prerelease) (PLD Linux) (...) sizeof(...)= 14 arch == pentium3. -- /* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */ #define say(x) lie(x) -------------- next part -------------- A non-text attachment was scrubbed... Name: packed.cpp Type: text/x-c++src Size: 466 bytes Desc: not available URL: From kkvamsi@yahoo.com Wed Aug 4 20:55:00 2004 From: kkvamsi@yahoo.com (vamsi KRISHNA) Date: Wed, 04 Aug 2004 20:55:00 -0000 Subject: error while installing gcc3.4.1 in compaq unix v5 Message-ID: <20040804165217.45109.qmail@web52707.mail.yahoo.com> hi, i am facing the following error while executing make command Configuring in libiberty configure: loading cache ./config.cache configure: error: `CFLAGS' has changed since the previous run: configure: former value: -O configure: current value: -g configure: error: changes in the environment can compromise the build configure: error: run `make distclean' and/or `rm ./config.cache' and start over *** Exit 1 Stop. what should i do to continue installing? bye vamsi __________________________________ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail From frostflare@bol.com.br Wed Aug 4 22:32:00 2004 From: frostflare@bol.com.br (frostflare) Date: Wed, 04 Aug 2004 22:32:00 -0000 Subject: Parse error Message-ID: I am using arm-elf-gcc to com?pile a C program, but it show this error: Decl_SON.h:46: error: parse error before "IRQHandler" And this is the lib Decl_SON.h that hhas the error: typedef struct { void (*TStart)(void); void *TStackLimit; unsigned long TStackPointer; char TName[10]; unsigned long TStackSize; unsigned short TSuspTics; } tcbstruc; extern unsigned long TIC; extern volatile unsigned long MainCounter; extern unsigned EXECUTIC; extern volatile unsigned PROTECT; extern volatile int CurrentTask; extern unsigned MainTask; extern tcbstruc TCB[]; extern tcbstruc* CurrentTaskPointer; void __irq IRQHandler(void); void SaveAndRestore(tcbstruc* SaveTask,tcbstruc* RestoreTask); void InitialiseContext(tcbstruc* tcb); void InitialiseTasks(void); void Suspend(unsigned SuspTics, unsigned long StartTic); void GPISR(void); Can somebody help me with this? Thankyou Wellington Brazil __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mcgehan@boulder.nist.gov Wed Aug 4 22:37:00 2004 From: mcgehan@boulder.nist.gov (mcgehan@boulder.nist.gov) Date: Wed, 04 Aug 2004 22:37:00 -0000 Subject: Retired! Message-ID: <200408042055.i74Kt3t13270@franklin.boulder.nist.gov> I have retired from federal service as of February 3, 2004. If you need assistance, please contact Mary Brunner at brunner@boulder.nist.gov From zhuw@ucla.edu Wed Aug 4 23:25:00 2004 From: zhuw@ucla.edu (Weijun Zhu) Date: Wed, 04 Aug 2004 23:25:00 -0000 Subject: undefined reference to ___gxx_personality_v0 Message-ID: <41116421.2000608@ucla.edu> Hello, I have a library compiled by g++ version 3.2 and have no problem link against it using g++ 3.2. But when I was linking against it using g++ 2.96 or g++ 3.3.1, I got the following error: undefined reference to ___gxx_personality_v0? Do I have to use the same g++ version as the library to link against it? Thanks, Weijun. From hueffner@informatik.uni-tuebingen.de Thu Aug 5 05:45:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Thu, 05 Aug 2004 05:45:00 -0000 Subject: undefined reference to ___gxx_personality_v0 In-Reply-To: <41116421.2000608@ucla.edu> (Weijun Zhu's message of "Wed, 04 Aug 2004 15:33:05 -0700") References: <41116421.2000608@ucla.edu> Message-ID: <87wu0esf7e.fsf@informatik.uni-tuebingen.de> Weijun Zhu writes: > I have a library compiled by g++ version 3.2 and have no problem link > against it using > g++ 3.2. But when I was linking against it using g++ 2.96 or g++ > 3.3.1, I got the following > error: > undefined reference to ___gxx_personality_v0? > > Do I have to use the same g++ version as the library to link against it? Yes. -- Falk From zhuw@ucla.edu Thu Aug 5 08:05:00 2004 From: zhuw@ucla.edu (Weijun Zhu) Date: Thu, 05 Aug 2004 08:05:00 -0000 Subject: undefined reference to ___gxx_personality_v0 In-Reply-To: <87wu0esf7e.fsf@informatik.uni-tuebingen.de> References: <41116421.2000608@ucla.edu> <87wu0esf7e.fsf@informatik.uni-tuebingen.de> Message-ID: <41117094.8000203@ucla.edu> Thanks! is there a way to compile the library such that it could be used on different versions of gcc? Weijun. Falk Hueffner wrote: >Weijun Zhu writes: > > > >>I have a library compiled by g++ version 3.2 and have no problem link >>against it using >>g++ 3.2. But when I was linking against it using g++ 2.96 or g++ >>3.3.1, I got the following >>error: >>undefined reference to ___gxx_personality_v0? >> >>Do I have to use the same g++ version as the library to link against it? >> >> > >Yes. > > > From alexvn@connect.to Thu Aug 5 10:42:00 2004 From: alexvn@connect.to (Alex Vinokur) Date: Thu, 05 Aug 2004 10:42:00 -0000 Subject: gcc: speed problem with several g++ versions References: <410E3788.1080806@math.tu-dresden.de> <87657zi7x7.fsf@informatik.uni-tuebingen.de> Message-ID: "Alex Vinokur" wrote in message news:ceq9t0$5d5$1@sea.gmane.org... > > "Falk Hueffner" wrote in message news:87657zi7x7.fsf@informatik.uni-tuebingen.de... > [snip] > > This seems to be something target specific; > [snip] > > Yes, performance of the same compiler on different targets is quite different. > See, for instance: > http://article.gmane.org/gmane.comp.lang.c%2B%2B.perfometer/37 > http://groups.google.com/groups?selm=biihim%249opf4%241%40ID-79865.news.uni-berlin.de > [snip] Also http://groups.google.com/groups?threadm=bjosu1%24lk214%241%40ID-79865.news.uni-berlin.de -- Alex Vinokur http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn From hueffner@informatik.uni-tuebingen.de Thu Aug 5 12:17:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Thu, 05 Aug 2004 12:17:00 -0000 Subject: undefined reference to ___gxx_personality_v0 In-Reply-To: <41117094.8000203@ucla.edu> (Weijun Zhu's message of "Wed, 04 Aug 2004 16:26:12 -0700") References: <41116421.2000608@ucla.edu> <87wu0esf7e.fsf@informatik.uni-tuebingen.de> <41117094.8000203@ucla.edu> Message-ID: <87d6266nm0.fsf@informatik.uni-tuebingen.de> Weijun Zhu writes: > Thanks! is there a way to compile the library such that it could be > used on different versions of gcc? No. >>>I have a library compiled by g++ version 3.2 and have no problem link >>>against it using >>>g++ 3.2. But when I was linking against it using g++ 2.96 or g++ >>>3.3.1, I got the following >>>error: >>>undefined reference to ___gxx_personality_v0? >>> >>>Do I have to use the same g++ version as the library to link against it? >> >>Yes. -- Falk From squareroot2@freemail.hu Thu Aug 5 15:11:00 2004 From: squareroot2@freemail.hu (Demeter =?ISO-8859-1?Q?=C1kos?=) Date: Thu, 05 Aug 2004 15:11:00 -0000 Subject: -mcpu vs -march Message-ID: <1091702519.5845.3.camel@nest> Hello! I searched the man to find that if for gcc multiple -O options are given then the last one will be used. for example: gcc -O3 -O2 is the same as gcc -O2 but I was searching for the -march and -mcpu. If both is given like: gcc -march=pentium3 -mcpu=pentium3 then what will it be? I found that -march implies -mcpu (like -O3 implies -O2) so I thought that then -mcpu will be used, but so said no. Some said, no matter the order of the two flags mcpu will be used. So I got confused. Thanks for your help! ps.: I'm not signed onto this mailinglist, so if you be so kind to CC the answer to my address as well. -- Demeter ?kos -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From eljay@adobe.com Thu Aug 5 17:12:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 05 Aug 2004 17:12:00 -0000 Subject: undefined reference to ___gxx_personality_v0 References: <41116421.2000608@ucla.edu> <87wu0esf7e.fsf@informatik.uni-tuebingen.de> <41117094.8000203@ucla.edu> Message-ID: <00ec01c47ae5$ef809f60$07b2f882@PS253> Hi Weijun, >is there a way to compile the library such that it could be used on different versions of gcc? Yes: compile the library with that different version of gcc. HTH, --Eljay From otto.wyss@orpatec.ch Thu Aug 5 17:32:00 2004 From: otto.wyss@orpatec.ch (Otto Wyss) Date: Thu, 05 Aug 2004 17:32:00 -0000 Subject: Gcc calls Id with unrecognized option '--as-needed' Message-ID: <41124E02.A55F0550@orpatec.ch> The configure of the wxWidgets package tests for gcc with a simple test app but during this test ld stops with error unrecognized option '--as-needed' (see log). ============================================ configure:9121: checking whether the C compiler (gcc ) works configure:9137: gcc -o conftest conftest.c 1>&5 /usr/bin/ld: unrecognized option '--as-needed' /usr/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status configure: failed program was: #line 9132 "configure" #include "confdefs.h" main(){return(0);} ============================================ Does anyone know why gcc calls ld with this option and how I could correct it? I use Debian/sarge with gcc -dumpversion 3.3.4 ld -V GNU ld version 2.14.90.0.7 20031029 Debian GNU/Linux O. Wyss -- See a huge pile of work at "http://wyodesktop.sourceforge.net/" From Claudio.Lavecchia@eurecom.fr Thu Aug 5 17:36:00 2004 From: Claudio.Lavecchia@eurecom.fr (Claudio Lavecchia) Date: Thu, 05 Aug 2004 17:36:00 -0000 Subject: Using signals in redhat linux Message-ID: <41126A76.60802@eurecom.fr> Hello people, I have a quick question about using signals in Linux environment - redhat 7.3. I'm using GCC version 2.96. I'm trying to launch and intercept signals - but the signals never get intercepted. Any of you guys have an idea of why? Do I have to set any compile option? I include the very simple test (using both alarm() and raise() to send signals) Thanks a lot Claudio #include #include #include void processAlarm() { signal(SIGALRM, processAlarm); printf("ALARM INTERCEPTED"); alarm(3); } void processSIG() { signal(100, processSIG); printf("SIG INTERCEPTED"); } int main(int argc, char *argv[]) { printf("Launching Alarm Test\n"); signal(SIGALRM, processAlarm); printf("Launching Alarm (previous alarm value: %d)\n",alarm(3)); printf("Alarm value:%d\n",alarm(0)); signal(100, processSIG); raise(100); while (1); return 0; } From ishwar@pali.cps.cmich.edu Thu Aug 5 18:16:00 2004 From: ishwar@pali.cps.cmich.edu (Ishwar Rattan) Date: Thu, 05 Aug 2004 18:16:00 -0000 Subject: Using signals in redhat linux In-Reply-To: <41126A76.60802@eurecom.fr> References: <41126A76.60802@eurecom.fr> Message-ID: Did your code work on any other system? Learn nature of signals and related calls first! -ishwar On Thu, 5 Aug 2004, Claudio Lavecchia wrote: > Hello people, > > I have a quick question about using signals in Linux environment - > redhat 7.3. > I'm using GCC version 2.96. > I'm trying to launch and intercept signals - but the signals never get > intercepted. > > Any of you guys have an idea of why? Do I have to set any compile option? > > I include the very simple test (using both alarm() and raise() to send > signals) > > Thanks a lot > > Claudio > > #include > #include > #include > > > void processAlarm() > { > signal(SIGALRM, processAlarm); > printf("ALARM INTERCEPTED"); > alarm(3); > } > > void processSIG() > { > signal(100, processSIG); > printf("SIG INTERCEPTED"); > } > > int main(int argc, char *argv[]) > { > printf("Launching Alarm Test\n"); > signal(SIGALRM, processAlarm); > > printf("Launching Alarm (previous alarm value: %d)\n",alarm(3)); > printf("Alarm value:%d\n",alarm(0)); > > signal(100, processSIG); > raise(100); > > while (1); > return 0; > } > From eljay@adobe.com Thu Aug 5 18:33:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 05 Aug 2004 18:33:00 -0000 Subject: Using signals in redhat linux References: <41126A76.60802@eurecom.fr> Message-ID: <01f701c47b12$8bd13d30$07b2f882@PS253> Hi Claudio, Your question is off-topic for this forum. This forum does not support Red Hat's 2.96 compiler (Red Hat has a forum for support of their compiler). This forum does not support Red Hat Linux 7.3 (Red Hat has support forums for that OS, including for developers). That being said... What are you NOT allowed to do within a signal? Depending on the platform, there are MANY caveats about what you can and cannot do within a signal handler. Typically: + no I/O (such as a printf) + no OS API calls* + in C++ land, no exceptions + no longjmp + no read/writing non-volatile variables + no exit / abort * The "no I/O" falls under this category, but it's so important I put it all by itself anyway. What should a signal handler do? As little as possible, as quickly as possible. Set a flag, and then have the regular program check that (volatile) flag for being changed. (I'm not sure about mutexes and condvars within signal handlers... probably another concern.) In a multi-threading program, I'm not sure if there is any guarantee which thread will be handling the signal. Probably varies from platform to platform. I'm not sure if any of the above is applicable to Red Hat Linux 7.3, or Red Hat 2.96 compiler. I'm not sure if there is a attribute decoration for the signal handling function in your situation (as I vaguely recall from my Borland Turbo C days). HTH, --Eljay From klindsay@sxip.com Thu Aug 5 18:44:00 2004 From: klindsay@sxip.com (Kevin Lindsay) Date: Thu, 05 Aug 2004 18:44:00 -0000 Subject: Statically Linked Shared Objects Message-ID: <4112797E.2040700@sxip.com> Hi, I am creating a statically linked shared object which I want to link to on different systems. The problem here is that this library is binary incompatible with the application that will be loading it, thus friendly segfaults appear. Specifically, glibc 2.3.2 symbols exist in this static library. I want an application compiled with glibc 2.2.5 to load it without symbol conflicts. This is what I have done so far: libA.so - Statically linked shared object using glibc 2.3.2. Module.so - Perl C module built with glibc-2.2.5 which links to libA.so. Perl, which is also using glibc-2.2.5 dynamically loads Module.so, a few system calls after dlopen() a segfault occurs. Any help is appreciated, thanks. Kevin- From silverbirdinternational@fastermail.com Thu Aug 5 23:40:00 2004 From: silverbirdinternational@fastermail.com (BEN BRUCE) Date: Thu, 05 Aug 2004 23:40:00 -0000 Subject: BEAUTY PAGENT DEAL. Message-ID: THIS IS TO INFORM YOU ABOUT A BUSINESS DEAL. A BEAUTY PAGENT WOULD BE HOLDING, WHICH WOULD ATTRACT THE SUM OF $1,000,000 US DOLLARS AND WOULD BE EXECUTED WITH THE SUM OF $500,000 US DOLLARS.THE PAGENT WOULD ATTRACT A MINIMUM OF 30% PERCENT INTREST TO YOU IF YOU CAN DONATE THE SUM OF $150,000 US DOLLARS .IF YOU ARE INTRESTED IN THE DEAL YOU CAN MAIL ME BACK. THANKS BEN BRUCE (CEO)SILVERBIRD INTERNATIONAL. From kalyan_ch@students.iiit.net Fri Aug 6 06:39:00 2004 From: kalyan_ch@students.iiit.net (EMPEROR) Date: Fri, 06 Aug 2004 06:39:00 -0000 Subject: gcc for unix system Message-ID: hi, I am trying to install gcc on a unix system.I dont know my processor so i cant specify host for configuring. but ./configure alone, i think is not working. First of all is gcc compatible with unix system. if yes can u kindly describe what i should do inorder to intall -- Do u know that a simple "hello" can be a sweet one? The word HELLO means: H = How r u ? E = Everythig all right ? L = Like to hear from u L = Love to see u O = Obviously, I miss u So HELLO :) From silverbirdinternational@fastermail.com Fri Aug 6 09:13:00 2004 From: silverbirdinternational@fastermail.com (BEN BRUCE) Date: Fri, 06 Aug 2004 09:13:00 -0000 Subject: BEAUTY PAGENT DEAL. Message-ID: THIS IS TO INFORM YOU ABOUT A BUSINESS DEAL. A BEAUTY PAGENT WOULD BE HOLDING, WHICH WOULD ATTRACT THE SUM OF $1,000,000 US DOLLARS AND WOULD BE EXECUTED WITH THE SUM OF $500,000 US DOLLARS.THE PAGENT WOULD ATTRACT A MINIMUM OF 30% PERCENT INTREST TO YOU IF YOU CAN DONATE THE SUM OF $150,000 US DOLLARS .IF YOU ARE INTRESTED IN THE DEAL YOU CAN MAIL ME BACK. THANKS BEN BRUCE (CEO)SILVERBIRD INTERNATIONAL. From john.carter@tait.co.nz Fri Aug 6 09:32:00 2004 From: john.carter@tait.co.nz (John Carter) Date: Fri, 06 Aug 2004 09:32:00 -0000 Subject: Carter's Merry Magic Link Time Registration of Callbacks. Message-ID: Here is an evil trick for you.... So we have a conundrum. We want... a) A true layered architecture. b) We want to be able to build and run each layer by itself. c) We trying to trim startup time, so run time registration is not preferred. d) We want the information relating to each layer to be in the correct module. e) This is embedded system, so we prefer fixed sizes to unbounded heap structures. Taraa! Enter Carter's Magical Mystical Link Time Callback Registration technique. (Thanks to JohnW for the suggestion of misusing "weak") At the bottom most layer we have a header file.... ==lower.h============================================================= #ifndef _LOWER_H #ifdef __GNUC__ #define WEAK __attribute__ ((weak)) #else #error This code is non-portable. #endif // Save parameter and notify all subscribers if new value is different // from the old value. void save( int); #endif ====================================================================== Note evil non-portable bit. However, don't sulk too badly, it probably isn't too difficult to port or to convert to run time registration again. ====lower.c=========================================================== #include #include "lower.h" typedef void callback_t(int); // Do nothing on callback. static void dummy(int i __attribute__ ((unused))) {} // Just tell linker all unused slots are dummy void __attribute__ ((weak,alias("dummy"))) slot_1(int); void __attribute__ ((weak,alias("dummy"))) slot_2(int); void __attribute__ ((weak,alias("dummy"))) slot_3(int); void __attribute__ ((weak,alias("dummy"))) slot_4(int); void __attribute__ ((weak,alias("dummy"))) slot_5(int); #define numSlots 5 static callback_t * const slots[numSlots] = {slot_1,slot_2,slot_3,slot_4,slot_5}; void save(int data) { static int data_store; if( data != data_store) { data_store = data; int i; for( i=0; i < numSlots; ++i) { (*(slots[i]))(data_store); } } } int WEAK main() { save(10); save(10); save(20); save(20); save(10); return 0; } ====================================================================== Here we have a fixed number of slots, packed with the address of dummy routines. Ooh. Looky it has it's own "main" routine. We can compile, link and run it like so... cc -Wall -W -O3 -c -o lower.o lower.c cc lower.o -o lower Run lower by itself lower Yip, it ran OK. So add one higher layer.... ==higher_a.h========================================================== #ifndef _HIGHER_A_H void hit_a(int); #endif ==higher_a.c========================================================== #include #include "lower.h" #include "higher_a.h" void slot_4(int i) { printf( "Module A has just been told that the new value is %d\n", i); } void hit_a(int value) { printf( "Hit A with a %d\n", value); save( value); } int WEAK main() { hit_a(-1); hit_a(1); hit_a(1); hit_a(2); return 0; } ====================================================================== This one uses slot_4 and ooh looky, it _also_ has a main. So we can compile, link and run it like so... cc -Wall -W -O3 -c -o higher_a.o higher_a.c cc higher_a.o lower.o -o higher_a Run higher_a by itself higher_a Hit A with a -1 Module A has just been told that the new value is -1 Hit A with a 1 Module A has just been told that the new value is 1 Hit A with a 1 Hit A with a 2 Module A has just been told that the new value is 2 Ooh Looky! We get a call back whenever the data store has changed. Note we didn't change a _single_ byte of lower.c or lower.h to create higher_a! We must be doing something right! But what about a peer for higher_a? Does that stuff things up? =higher_b.h=========================================================== #ifndef _HIGHER_B_H void hit_b(int); #endif =higher_b.c=========================================================== #include #include "lower.h" #include "higher_b.h" void slot_2(int i) { printf( "Module B has just been told that the new value is %d\n", i); } void hit_b(int value) { printf( "Hit B with a %d\n", value); save( value); } int WEAK main() { hit_b(-1); hit_b(1); hit_b(1); hit_b(2); return 0; } ====================================================================== This is just a proof of concept so higher_b is just the same as higher_a except I have used slot_2 this time. In reality is would be an entirely different module. cc -Wall -W -O3 -c -o higher_b.o higher_b.c cc higher_b.o lower.o -o higher_b Run higher_b by itself higher_b Hit B with a -1 Module B has just been told that the new value is -1 Hit B with a 1 Module B has just been told that the new value is 1 Hit B with a 1 Hit B with a 2 Module B has just been told that the new value is 2 Great, not a byte of lower.c, lower.h or higher_a.c change to create higher_b. We must be doing something right! So can we have a super layer? =====top_layer.c====================================================== #include "higher_a.h" #include "higher_b.h" int main() { hit_a(10); hit_b(30); hit_a(30); return 0; } ====================================================================== Compile and link it... cc -Wall -W -O3 -c -o top_layer.o top_layer.c cc top_layer.o higher_a.o higher_b.o lower.o -o top_layer That was easy. We didn't change a single bit of lower.c, lower.h, higher_a.h, higher_b.h, higher_a.c, or higher_b.c We _really_ must be doing something right. So let's run it and see if it works... top_layer Hit A with a 10 Module B has just been told that the new value is 10 Module A has just been told that the new value is 10 Hit B with a 30 Module B has just been told that the new value is 30 Module A has just been told that the new value is 30 Hit A with a 30 Yup, it all just works! And here is the Makefile.. ==Makefile============================================================ CFLAGS = -Wall -W -O3 all : lower higher_a higher_b top_layer @echo Run lower by itself lower @echo Run higher_a by itself higher_a @echo Run higher_b by itself higher_b @echo Run toplayer top_layer lower : lower.o lower.o : lower.c lower.h higher_a : higher_a.o lower.o higher_a.o : higher_a.c lower.h higher_b : higher_b.o lower.o higher_b.o : higher_b.c lower.h top_layer.o : top_layer.c lower.h top_layer : top_layer.o higher_a.o higher_b.o lower.o .PHONY : clean clean : -rm -v *.o lower higher_a higher_b top_layer ====================================================================== John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand The universe is absolutely plastered with the dashed lines exactly one space long. From thl@dev.de.cw.com Fri Aug 6 18:39:00 2004 From: thl@dev.de.cw.com (Thomas Lotterer) Date: Fri, 06 Aug 2004 18:39:00 -0000 Subject: Gcc calls Id with unrecognized option '--as-needed' In-Reply-To: <41124E02.A55F0550@orpatec.ch> References: <41124E02.A55F0550@orpatec.ch> Message-ID: <20040806091338.GC33746@dev.de.cw.com> On Thu, Aug 05, 2004, Otto Wyss wrote: > The configure of the wxWidgets package tests for gcc with a simple > test app but during this test ld stops with error unrecognized option > '--as-needed' (see log) [...] > > Does anyone know why gcc calls ld with this option and how I could > correct it? > http://cvs.openpkg.org/chngview?cn=16830 reads: Accept (and ignore) --as-needed/--no-as-needed options from GNU binutils 2.15 in our GNU binutils 2.14 to resolve a chicken and egg problem under platforms (like Fedora Core 2) which already run GNU binutils 2.15: the vendor cc(1) knows that it has ld(1) from GNU binutils 2.15 and hence always uses the --as-needed option when calling ld(1). Unfortunately, between having built "binutils" and "gcc" packages, this will break OpenPKG because the vendor cc(1) would run the OpenPKG ld(1) with an option it (still) does not understand. The only workaround is to let our ld(1) accept and ignore this option. Once our cc(1) from "gcc" package is installed, the problem is gone, because our "gcc" package correctly detects that our ld(1) still does ot understand --as-needed. -- Thomas.Lotterer@cw.com, Cable & Wireless From thl@dev.de.cw.com Fri Aug 6 19:19:00 2004 From: thl@dev.de.cw.com (Thomas Lotterer) Date: Fri, 06 Aug 2004 19:19:00 -0000 Subject: gcc for unix system In-Reply-To: References: Message-ID: <20040806093237.GD33746@dev.de.cw.com> On Fri, Aug 06, 2004, EMPEROR wrote: > I am trying to install gcc on a unix system.I dont know > my processor [...] > Try OpenPKG [1] from source, it'll find out. You need the bootstrap package, make, binutils and gcc. Have a look at the tutorial [2] or give it a dry run viewing the showcase [3] (animated GIF). You can even build and install OpenPKG as unprivileged user. If the build fails at least you'll get GNU shtool 2.0 with the download. It'll help you even if you decide not to go the OpenPKG route. It is available from OSSP [4]. Find out which arch-os (used to name OpenPKG binary RPMs) $ shtool platform -t binary Find CPU/system architecture/product/technology in human readable format $ shtool platform -t all-in-one [1] http://www.openpkg.org/ [2] http://www.openpkg.org/tutorial.html [3] http://www.openpkg.org/showcase.html [4] http://www.ossp.org/pkg/tool/shtool/ -- Thomas.Lotterer@cw.com, Cable & Wireless From zhuw@ucla.edu Fri Aug 6 19:27:00 2004 From: zhuw@ucla.edu (Weijun Zhu) Date: Fri, 06 Aug 2004 19:27:00 -0000 Subject: remove unused symbol and function Message-ID: <4113D06A.1040801@ucla.edu> Hello, A function (say foo1) in an object file calls a library function (say foo2). The library does not exist on the system. foo1 is not called in the target that I am building. But the GCC gives me an error that undefined reference to foo2 while linking? Is there a way to avoid linking unused symbols? Weijun. From eljay@adobe.com Fri Aug 6 20:21:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 06 Aug 2004 20:21:00 -0000 Subject: remove unused symbol and function References: <4113D06A.1040801@ucla.edu> Message-ID: <00cd01c47bea$3c7ac8e0$75b2f882@PS253> Hi Weijun, You could try -ffunction-sections, -fdata-sections, and -gc-sections (garbage collect unused sections). May or may not work, and could be platform dependent as to how well they work. You're better off not including the unused foo1 which depends on unresolveable foo2 in the first place. Another hack would be to define a (spoofed and also unused) foo2. That'd make foo1 happy. HTH, --Eljay "Don't anthropomorphize computers. They hate it when you do that." From bvds@bvds.geneva.edu Fri Aug 6 20:43:00 2004 From: bvds@bvds.geneva.edu (bvds@bvds.geneva.edu) Date: Fri, 06 Aug 2004 20:43:00 -0000 Subject: g77 and valgrind error? Message-ID: <200408061927.i76JRqik014917@bvds.geneva.edu> I am using valgrind on a g77 program and am getting some peculiar results: Cccccccccccccccccccccccccccccccccccccccccc program memty integer i i=360 call fsub(i) end C subroutine fsub(i) integer i double complex x(i,i) x(i,i)=complex(0D0,0D0) end Ccccccccccccccccccccccccccccccccccccccccc Valgrind gives an error of the form: ==12420== Invalid write of size 8 ==12420== at 0x8048671: fsub_ (memty.f:10) ==12420== by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61) ==12420== Address 0x52BFE8A0 is on thread 1's stack ==12420== ==12420== Invalid write of size 8 ==12420== at 0x8048679: fsub_ (memty.f:10) ==12420== by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61) ==12420== Address 0x52BFE8A8 is on thread 1's stack Some more info: bvds> uname -a Linux bvds 2.4.25 #1 SMP Sat Mar 20 15:34:02 EST 2004 i686 i686 i386 GNU/Linux bvds> g77 --version GNU Fortran (GCC) 3.3.2 bvds> valgrind --version valgrind-2.1.2 I see the same behavior in valgrind-2.0.0. This only happens for complex arrays. if I use the g77 flag -femulate-complex, then there is one error. (I have also sent this to the valgrind mailing list.) Any ideas? Brett van de Sande From toon@moene.indiv.nluug.nl Fri Aug 6 20:57:00 2004 From: toon@moene.indiv.nluug.nl (Toon Moene) Date: Fri, 06 Aug 2004 20:57:00 -0000 Subject: Anyone knowlegable about valgrind ? Was: Re: g77 and valgrind error? In-Reply-To: <200408061927.i76JRqik014917@bvds.geneva.edu> References: <200408061927.i76JRqik014917@bvds.geneva.edu> Message-ID: <4113E9B8.3070501@moene.indiv.nluug.nl> bvds@bvds.geneva.edu wrote: > I am using valgrind on a g77 program and am getting > some peculiar results: > > Cccccccccccccccccccccccccccccccccccccccccc > program memty > integer i > i=360 > call fsub(i) > end > C > subroutine fsub(i) > integer i > double complex x(i,i) > x(i,i)=complex(0D0,0D0) > end > Ccccccccccccccccccccccccccccccccccccccccc > > Valgrind gives an error of the form: I do not know anything about valgrind, but the Fortran code is perfectly OK. It uses an automatic array x in subroutine fsub that is dimensioned using the dummy argument i, which is an extension of Fortran 77, but allowed in Fortran 90 and supported by g77. I tried your code using g77-3.3.4 as supplied by Debian on their testing platform (up-to-date as of Sunday 1/8/2004) and it performs perfectly. I'm afraid someone else has to help you here (that's why I changed the subject). Cheers, -- Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/ From bvds@bvds.geneva.edu Fri Aug 6 22:35:00 2004 From: bvds@bvds.geneva.edu (bvds@bvds.geneva.edu) Date: Fri, 06 Aug 2004 22:35:00 -0000 Subject: Anyone knowlegable about valgrind ? Was: Re: g77 and valgrind error? In-Reply-To: <4113E9B8.3070501@moene.indiv.nluug.nl> (message from Toon Moene on Fri, 06 Aug 2004 22:27:36 +0200) References: <200408061927.i76JRqik014917@bvds.geneva.edu> <4113E9B8.3070501@moene.indiv.nluug.nl> Message-ID: <200408062043.i76KhNcG004458@bvds.geneva.edu> > >I do not know anything about valgrind, but the Fortran code is perfectly >OK. It uses an automatic array x in subroutine fsub that is dimensioned >using the dummy argument i, which is an extension of Fortran 77, but >allowed in Fortran 90 and supported by g77. Yes, the code itself is OK... Another detail that I forgot to mention is that the valgrind error goes away when i=350. Is there anything about memory allocation in g77 that would change with increasing i? I have also put this question to the valgrind people, but *they* probably don't know much about g77. BvdS From toon@moene.indiv.nluug.nl Fri Aug 6 22:40:00 2004 From: toon@moene.indiv.nluug.nl (Toon Moene) Date: Fri, 06 Aug 2004 22:40:00 -0000 Subject: Anyone knowlegable about valgrind ? Was: Re: g77 and valgrind error? In-Reply-To: <200408062043.i76KhNcG004458@bvds.geneva.edu> References: <200408061927.i76JRqik014917@bvds.geneva.edu> <4113E9B8.3070501@moene.indiv.nluug.nl> <200408062043.i76KhNcG004458@bvds.geneva.edu> Message-ID: <4113F240.30207@moene.indiv.nluug.nl> bvds@bvds.geneva.edu wrote: >>I do not know anything about valgrind, but the Fortran code is perfectly >>OK. It uses an automatic array x in subroutine fsub that is dimensioned >>using the dummy argument i, which is an extension of Fortran 77, but >>allowed in Fortran 90 and supported by g77. > > Yes, the code itself is OK... > Another detail that I forgot to mention is that the valgrind > error goes away when i=350. Is there anything about memory > allocation in g77 that would change with increasing i? > > I have also put this question to the valgrind people, but > *they* probably don't know much about g77. I wouldn't know why 360 is a "magic number", but g77 doesn't do anything but place the automatic array on the stack. Therefore, we have to deal with 16 * 360 * 360 bytes = slightly over 2 megabytes of stack space. I can't see why this would be a problem (unless other automatic arrays are also dimensioned using `i'. Cheers, -- Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/ From adrianb@cs.cmu.edu Sat Aug 7 04:26:00 2004 From: adrianb@cs.cmu.edu (Adrian Broadhurst) Date: Sat, 07 Aug 2004 04:26:00 -0000 Subject: erratic typeinfo problem on mac (gcc 3.3) Message-ID: Hi I am having problems with gcc version 3.3 (and 3.1) on OS X 10.2.8 This problem is not easily repeatable. When I compile with -O0 and -g, the compiler is not instantiating all the typeinfo needed to link the project. This problem does not occur on i686 platforms. The error occurs in about 1 of 100 modules, but the affected module changes erratically. The project is linked indirectly using 'ar' archive tool. .cc -> .o -> libLibrary.a -> executable. I have not been able to reproduce this problem in a small scale project. I can sometimes get the program to link by linking the effected modules twice (once with -O3 and once with -O0). Is this a known problem? Adrian From rradford@mindspring.com Sat Aug 7 11:43:00 2004 From: rradford@mindspring.com (Rodney Radford) Date: Sat, 07 Aug 2004 11:43:00 -0000 Subject: Problem with GCC 3.4 vs 3.3 and packed structs Message-ID: <27625254.1091831996772.JavaMail.root@wamui10.slb.atl.earthlink.net> The following code snippet works as expected in GCC 3.3.3 (both i686 and x86_64 platforms), but fails with a compile error on GCC 3.4: #define PACKED __attribute__ ((packed)) struct three { char larry; char curly; char moe; } PACKED *stooges; char & knucklehead(void) { return stooges->moe; } The compile error is: packed.c: In function `char& knucklehead()': packed.c:12: error: cannot bind packed field `stooges->three::moe' to `char&' I searched through the GCC message archives and did run across a series of messages that state that fields in packed structures are now treated as if they are bitfields and taking the address of (or reference of) the fields is not supported. Unfortunately, our application relies heavily on packed structures and uses the above construct frequently. I have tried moving the PACKED attribute to the individual fields, or after "three", as well as applying it to the referenc of knucklehead, but all to no avail. Is there any work around - either via a compiler option, or a change to our source code (other than removing the packed attribute) that you can recommend? Similarly, I read through the information in the GCC 3.4.1 manual on the use of the packed attribute and tried the following sequence of code taken straight from the manual: struct my_unpacked_struct { char c; int i; }; struct my_packed_struct __attribute__ ((__packed__)) { char c; int i; struct my_unpacked_struct s; }; This code also fails to compile, but with a different message: packed.c:9: error: expected unqualified-id before '{' token packed.c:9: error: expected `,' or `;' before '{' token Any assistance, or advice, is greatly appreciated. Thanx. PS: This email address is protected via Earthlink's spamBlocker, so any sender will receive an email message pointing them to a webpage where they must first request to be added to my approved list before the email can be delivered. I check the 'spam folder' regularly, but occasionally miss a real message, so I apologize for the inconvenience, but I request that you please follow through the simple steps to make sure the email is sent on to me. From jaf@lcsaudio.com Sat Aug 7 13:07:00 2004 From: jaf@lcsaudio.com (Jeremy Friesner) Date: Sat, 07 Aug 2004 13:07:00 -0000 Subject: subscribe jaf@lcsaudio.com Message-ID: <200408062125.28317.jaf@lcsaudio.com> subscribe jaf@lcsaudio.com From bvds@bvds.geneva.edu Sun Aug 8 17:49:00 2004 From: bvds@bvds.geneva.edu (bvds@bvds.geneva.edu) Date: Sun, 08 Aug 2004 17:49:00 -0000 Subject: Anyone knowlegable about valgrind ? Was: Re: g77 and valgrind error? In-Reply-To: <4113F240.30207@moene.indiv.nluug.nl> (message from Toon Moene on Fri, 06 Aug 2004 23:04:00 +0200) References: <200408061927.i76JRqik014917@bvds.geneva.edu> <4113E9B8.3070501@moene.indiv.nluug.nl> <200408062043.i76KhNcG004458@bvds.geneva.edu> <4113F240.30207@moene.indiv.nluug.nl> Message-ID: <200408071143.i77Bhnmq005332@bvds.geneva.edu> >> >> ==12420== Invalid write of size 8 >> ==12420== at 0x8048671: fsub_ (memty.f:10) >> ==12420== by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61) >> ==12420== Address 0x52BFE8A0 is on thread 1's stack >> ==12420== >> ==12420== Invalid write of size 8 >> ==12420== at 0x8048679: fsub_ (memty.f:10) >> ==12420== by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61) >> ==12420== Address 0x52BFE8A8 is on thread 1's stack > >If you run with -v you will see this warning: > >==9495== Warning: thread 1 switching stacks? %esp: 0x52BFEA10 --> 0x52A04610 > >What's happening is that the very large array is using about 1Mb of >stack space and that is confusing valgrind into thinking that the >thread has switched to a different stack so it doesn't mark all that >space as writable and then you get invalid write warnings. > >Tom > >-- >Tom Hughes (thh@cyberscience.com) >Software Engineer, Cyberscience Corporation >http://www.cyberscience.com/ > Here is the reply from one of the valgrind people, which clears things up a bit. It is interesting that this *only* happens for type complex. Thanks, Brett van de Sande From bilha.sandak@weizmann.ac.il Mon Aug 9 04:03:00 2004 From: bilha.sandak@weizmann.ac.il (Bilha Sandak) Date: Mon, 09 Aug 2004 04:03:00 -0000 Subject: inquiry Message-ID: <200408071307.QAA8603328@bina.wisdom.weizmann.ac.il> Dear All, I wish to install a stable running version of gcc (Fortran,c,c++) on a PC/Linux machine (Intel Pentium-4 2.8GHz with 2GB memory and 200GB disk-space). I will be much obliged to you for instructing me on the fastest, safest and self-contained way of doing so. I thank you. Sincerely, Dr. B. Sandak From ranko@spidernet.net Mon Aug 9 11:20:00 2004 From: ranko@spidernet.net (Ranko Zivojnovic) Date: Mon, 09 Aug 2004 11:20:00 -0000 Subject: Warnings with __builtin_choose_expr & __builtin_types_compatible_p Message-ID: <1091987259.1104.56.camel@zranko.spidernet.com.cy> Greetings, I'm not sure if I'm missing something: when I try to compile the below test case I get: [ranko@ranko-home tmp]% gcc -o test-case test-case.c test-case.c: In function `main': test-case.c:40: warning: passing arg 1 of `example_func2' from incompatible pointer type test-case.c:41: warning: passing arg 1 of `example_func1' from incompatible pointer type The code is correct and the correct functions do get executed. I would like however to get rid of the false warnings during the compilation. [ranko@ranko-home tmp]% ./test-case in example_func1() test: 0 in example_func2() ts: 30 Thanks and best regards, Ranko [ranko@ranko-home tmp]% gcc -v Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) /* test-case.c */ #include #include typedef struct example { int t1; int t2; int t3; int t4; } example_t; unsigned long long example_func1(unsigned long *ulp) { printf("in example_func1()\n"); return (0 + *ulp); } unsigned long long example_func2(example_t *tp) { printf("in example_func2()\n"); return (unsigned long long)(tp->t1 + tp->t2 + tp->t3 + tp->t4); } #define example_def(x) \ __builtin_choose_expr( \ __builtin_types_compatible_p(typeof (x), unsigned long), \ example_func1(&(x)), \ __builtin_choose_expr( \ __builtin_types_compatible_p (typeof (x), example_t), \ example_func2(&(x)), abort())) static unsigned long test = 0; static example_t ts = { 2, 4, 8, 16 }; int main(int argc, char *argv[]) { printf("test: %llu\n", example_def(test)); printf("ts: %llu\n", example_def(ts)); return 0; } -- Ranko Zivojnovic, IT Director/CTO ranko@spidernet.net Spidernet Services Ltd., Tel: +357 22 844844 Nicosia, Cyprus FAX: +357 22 669470 From linux@rochester.rr.com Mon Aug 9 12:06:00 2004 From: linux@rochester.rr.com (Marty Leisner) Date: Mon, 09 Aug 2004 12:06:00 -0000 Subject: using #ident or #pragma ident Message-ID: <200408090402.i7942tVN002698@dell.home> I'm using 3.4.1 on linux I found documentation on #pragma ident and #ident skimpy -- I tried to use them and can't have them mark the output files... Can someone show me an example where these are used? : leisner@gateway;gcc -v foo.c -save-temps -c Reading specs from /usr/gnu/lib/gcc/i686-pc-linux-gnu/3.4.1/specs Configured with: /usr/local/src/gnu/gcc-3.4.1/configure --prefix=/usr/gnu --prog ram-suffix=-3.4.1 --enable-shared --enable-__cxa_atexit --with-system-zlib --ena ble-threads=posix --disable-checking Thread model: posix gcc version 3.4.1 /usr/gnu/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1 -E -quiet -v foo.c -mtune=pent iumpro -o foo.i ignoring nonexistent directory "/usr/gnu/lib/gcc/i686-pc-linux-gnu/3.4.1/../../ . ./../i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/gnu/include /usr/gnu/lib/gcc/i686-pc-linux-gnu/3.4.1/include /usr/include End of search list. /usr/gnu/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1 -fpreprocessed foo.i -quiet -d umpbase foo.c -mtune=pentiumpro -auxbase foo -version -o foo.s GNU C version 3.4.1 (i686-pc-linux-gnu) compiled by GNU C version 3.4.1. GGC heuristics: --param ggc-min-expand=72 --param ggc-min-heapsize=80392 foo.c:1:10: warning: extra tokens at end of #ident directive /usr/gnu/lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/bin/as - V -Qy -o foo.o foo.s GNU assembler version 2.15 (i686-pc-linux-gnu) using BFD version 2.15 : leisner@gateway;cat foo.c #ident "this is an ident" #pragma ident "this is a pragma" main() { } : leisner@gateway;cat foo.i # 1 "foo.c" # 1 "" # 1 "" # 1 "foo.c" #ident ""this is an ident"" #pragma ident "this is a pragma" main() { } : leisner@gateway;cat foo.s .file "foo.c" .ident "" .text .globl main .type main, @function main: pushl %ebp movl %esp, %ebp subl $8, %esp andl $-16, %esp movl $0, %eax addl $15, %eax addl $15, %eax shrl $4, %eax sall $4, %eax subl %eax, %esp leave ret .size main, .-main .section .note.GNU-stack,"",@progbits .ident "GCC: (GNU) 3.4.1" marty From ankitjain1580@yahoo.com Mon Aug 9 12:08:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 12:08:00 -0000 Subject: extended asm problem->pointers->m1 Message-ID: <20040809112006.67832.qmail@web52902.mail.yahoo.com> 1 #include 2 3 4 int main() 5 { 6 uint8_t a[8]={1,2,3,4,5,6,7,8},b[8]={0,0,0,0,0,0},i; 7 uint8_t *m,*m1; 8 9 m=a; 10 11 for(i=0;i<8;i++) 12 printf("%d ",a[i]); 13 printf("\n"); 14 asm("movq (%1), %%mm0 \n" 15 "movq %%mm0, (%1) \n" 16 :"=r"(m1) 17 :"r"(m) 18 ); 19 20 for(i=0;i<8;i++) 21 printf("%d ",b[i]); 22 return 0; 23 } the problem in this code is it is printing array b as 00000000 it is not moving the values WHY? ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From marcelo@jct.ac.il Mon Aug 9 12:15:00 2004 From: marcelo@jct.ac.il (Marcelo Roitburd) Date: Mon, 09 Aug 2004 12:15:00 -0000 Subject: memory function Message-ID: Hi ppl, I know i wrote before a few time about this , but i need to write again. i read a the list at net of the gcc help about this i can't found a real something that help me. i need to know how much memory use each function like a sizeof function , that ppl write here before. if someone can send me some example with use class. i read about mprof some one know something like about this? or if gprof have some argument to this? thanks very thanks -Marcelo From eljay@adobe.com Mon Aug 9 12:19:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 12:19:00 -0000 Subject: using #ident or #pragma ident References: <200408090402.i7942tVN002698@dell.home> Message-ID: <007901c47e09$8fbefb40$79b2f882@PS253> Hi Marty, Try: #ident "This is an ident" And don't forget the -fident switch on your compile line. --Eljay From eljay@adobe.com Mon Aug 9 13:02:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 13:02:00 -0000 Subject: inquiry References: <200408071307.QAA8603328@bina.wisdom.weizmann.ac.il> Message-ID: <009e01c47e0a$759183e0$79b2f882@PS253> Hi Bilha, The fastest, safest, and self-contained way of installing GCC on your PC/Linux machine is when you install Linux from your distribution, make sure you select "ALL" packages. That will install the GCC (and all its related components) that the distribution expects. If you've already installed Linux and need to install GCC after-the-fact, I'm not sure what the procedure is to install packages that were not installed at set-up time. HTH, --Eljay From eljay@adobe.com Mon Aug 9 13:18:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 13:18:00 -0000 Subject: extended asm problem->pointers->m1 References: <20040809112006.67832.qmail@web52902.mail.yahoo.com> Message-ID: <00bb01c47e0b$237bea40$79b2f882@PS253> Hi Ankit, Does m1 need to point to something? --Eljay From eljay@adobe.com Mon Aug 9 13:34:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 13:34:00 -0000 Subject: memory function References: Message-ID: <013c01c47e11$0b15fa30$79b2f882@PS253> Hi Marcelo, In code, there is no language specified reliable way to determine the size of a function. There are a few suspect tricks you could try (such as taking the address of the NEXT function in the source code and subtracting the address of the function of interest), but they are fraught with danger. Outside of the code, try using the "nm" and "objdump" commands to peruse the attributes of your object code. HTH, --Eljay From ankitjain1580@yahoo.com Mon Aug 9 13:45:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 13:45:00 -0000 Subject: extended asm problem ->pointer m1 Message-ID: <20040809131759.12545.qmail@web52910.mail.yahoo.com> sorry i made the mistake in explaining my problem if u can look at it again 1 #include 2 3 4 int main() 5 { 6 uint8_t a[8]={1,2,3,4,5,6,7,8},b[8]={0,0,0,0,0,0},i; 7 uint8_t *m,*m1; 8 9 m=a; 10 m1=b; //i have pointed m1 to b 11 for(i=0;i<8;i++) 12 printf("%d ",a[i]); 13 printf("\n"); 14 asm("movq (%1), %%mm0 \n" 15 "movq %%mm0, (%1) \n" 16 :"=r"(m1) 17 :"r"(m) 18 ); 19 20 for(i=0;i<8;i++) 21 printf("%d ",b[i]); 22 return 0; 23 } so i expect that b should be initialised the problem in this code is it is printing array b as 00000000 it is not moving the values WHY? ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From eljay@adobe.com Mon Aug 9 14:09:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 14:09:00 -0000 Subject: extended asm problem ->pointer m1 References: <20040809131759.12545.qmail@web52910.mail.yahoo.com> Message-ID: <01b401c47e15$91151ef0$79b2f882@PS253> Hi Ankit, Should you be using (%1) in both assembler statements? --Eljay From eljay@adobe.com Mon Aug 9 14:10:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 14:10:00 -0000 Subject: extended asm problem ->pointer m1 References: <20040809131759.12545.qmail@web52910.mail.yahoo.com> Message-ID: <01bf01c47e17$26f40390$79b2f882@PS253> Hi Ankit, Maybe it'd be easier just to use the arrays directly: asm ( "movq %0 , %%mm0\n\t" "movq %%mm0 , %1\n\t" :"=m" (a[0]) :"m" (b[0]) ); HTH, --Eljay From laflynn@lucent.com Mon Aug 9 14:25:00 2004 From: laflynn@lucent.com (Flynn, Lori Arline (Lori)) Date: Mon, 09 Aug 2004 14:25:00 -0000 Subject: gcc LALR? Message-ID: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> Hi, Does anybody know if gcc is LALR, LR, or LL? I can't find documentation on this. Thanks, Lori From laflynn@lucent.com Mon Aug 9 14:25:00 2004 From: laflynn@lucent.com (Flynn, Lori Arline (Lori)) Date: Mon, 09 Aug 2004 14:25:00 -0000 Subject: join Message-ID: <9B457B1322AAAE46BD5E693C02842C1D02FE0748@nj0117exch002u.wh.lucent.com> join From eljay@adobe.com Mon Aug 9 14:41:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 14:41:00 -0000 Subject: gcc LALR? References: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> Message-ID: <021401c47e1c$afbefd10$79b2f882@PS253> Hi Lori, As I understand it, I believe gcc (the C compiler of the GCC suite) is LALR. If you want to write your own front end to GCC, you'd probably want LALR. But that's up to you. There's an essay called "GCC Fontend HOWTO" by Sreejith K Menon that's pretty cool. (You'll have to Google for it. I don't have the URL.) Since I'm not sure why you want to know, I'm not sure where I can point you to get to where you want to be. HTH, --Eljay From lars.segerlund@comsys.se Mon Aug 9 14:56:00 2004 From: lars.segerlund@comsys.se (Lars Segerlund) Date: Mon, 09 Aug 2004 14:56:00 -0000 Subject: memory function In-Reply-To: References: Message-ID: <20040809160927.6aa94708@zeta.comsys.se> Hi, you can insert labels into the code at the points you desire ( ie. before and after ) and then resolve them at runtime. I did a trick like this in order to place code at a desired location ( stupid linker tricks :-) ... perhaps you should ask on the binutils list ? ). I fooled around until I managed to put a marker before and after the code I wanted to run, and then got the addresses at runtime .. Just a thought, Lars Segerlund. ( ps. I tried to find the code but it's long dead and I can't find it ). On Mon, 9 Aug 2004 15:06:33 +0300 (IDT) Marcelo Roitburd wrote: > > Hi ppl, > > I know i wrote before a few time about this , but i need to write again. > > i read a the list at net of the gcc help about this i can't found a real > something that help me. > > i need to know how much memory use each function like a sizeof function , > that ppl write here before. > > if someone can send me some example with use class. i read about mprof > some one know something like about this? or if gprof have some argument to > this? > > thanks very thanks > > > -Marcelo > From ankitjain1580@yahoo.com Mon Aug 9 15:20:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 15:20:00 -0000 Subject: sorry again:)->extended asm problem Message-ID: <20040809144126.17842.qmail@web52901.mail.yahoo.com> sorry again. i generally dont make such mistyakes while asking questiuons. but yes it should %0. and i want it through pointers. earlier my program was having all these things correct but somewhat later i have done all these mistakes in the code and while sending the problem i pasted this error code. i guess the code below is correct and i have to understand why array b is not initialised with the value 1 #include 2 3 4 int main() 5 { 6 uint8_t a[8]={1,2,3,4,5,6,7,8},b[8]={0,0,0,0,0,0},i; 7 uint8_t *m,*m1; 8 9 m=a; 10 m1=b; //i have pointed m1 to b 11 for(i=0;i<8;i++) 12 printf("%d ",a[i]); 13 printf("\n"); 14 asm("movq (%1), %%mm0 \n" 15 "movq %%mm0, (%0) \n" 16 :"=r"(m1) 17 :"r"(m) 18 ); 19 20 for(i=0;i<8;i++) 21 printf("%d ",b[i]); 22 return 0; 23 } so i expect that b should be initialised the problem in this code is it is printing array b as 00000000 it is not moving the values WHY? thanks a lot ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From Tom.Richardson@ci.greensboro.nc.us Mon Aug 9 15:29:00 2004 From: Tom.Richardson@ci.greensboro.nc.us (Richardson, Tom) Date: Mon, 09 Aug 2004 15:29:00 -0000 Subject: Apache Install Message-ID: <8AA6C9941957884BA59B0ECED88F42BA0493128A@paris.greensboronc.org> I'm attempting to install Apache 2.0 on AIX 5.2. Ran into problems with my IBM C Compiler, so installed GCC. Configure worked fine. Only used one option in the configure ./configure --enable-so Getting errors on the make command. The command it is running is as follows: Making all in srclib Making all in apr Making all in strings /bin/sh /803Environment/httpd-2.0.50/srclib/apr/libtool --silent --mode= compile gcc -g -O2 -DHAVE_CONFIG_H -U__STR__ -D_THREAD_SAFE -D_USE_IRS -I../ include -I../include/arch/unix -c apr_snprintf.c && touch apr_snprintf.lo The error: In file included from ../include/apr_portable.h:46, from apr_snprintf.c:22: /usr/include/pthread.h:554: error: parse error before '*' token /usr/include/pthread.h:557: error: parse error before '*' token /usr/include/pthread.h:561: error: parse error before '*' token /usr/include/pthread.h:564: error: parse error before '*' token /usr/include/pthread.h:567: error: parse error before '*' token /usr/include/pthread.h:570: error: parse error before '*' token /usr/include/pthread.h:573: error: parse error before '*' token /usr/include/pthread.h:576: error: parse error before '*' token /usr/include/pthread.h:579: error: parse error before '*' token /usr/include/pthread.h:583: error: parse error before '*' token /usr/include/pthread.h:586: error: parse error before '*' token make: 1254-004 The error code from the last command is 1. I installed gcc binaries without any configuration. Any ideas greatly appreciated. Tom Richardson Application Services (336) 373-2016 tom.richardson@greensboro-nc.gov From pluto@pld-linux.org Mon Aug 9 16:05:00 2004 From: pluto@pld-linux.org (=?utf-8?q?Pawe=C5=82_Sikora?=) Date: Mon, 09 Aug 2004 16:05:00 -0000 Subject: sorry again:)->extended asm problem In-Reply-To: <20040809144126.17842.qmail@web52901.mail.yahoo.com> References: <20040809144126.17842.qmail@web52901.mail.yahoo.com> Message-ID: <200408091720.17349.pluto@pld-linux.org> # gcc -s -O2 mmx.c # ./a.out 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 -- /* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */ #define say(x) lie(x) -------------- next part -------------- A non-text attachment was scrubbed... Name: mmx.c Type: text/x-csrc Size: 435 bytes Desc: not available URL: From thebrasse@brasse.org Mon Aug 9 16:33:00 2004 From: thebrasse@brasse.org (=?ISO-8859-1?Q?Mattias_Br=E4ndstr=F6m?=) Date: Mon, 09 Aug 2004 16:33:00 -0000 Subject: Confused about linking Message-ID: <41179843.5010404@brasse.org> Hello! I am seriously confused when it comes to linking my executable written in C++. More specificaly I want to link againts boost_thread and boost_regex on a Fedora 2 system. These files are located in /usr/lib: /usr/lib/libboost_thread.so.1 /usr/lib/libboost_thread.so.1.31.0 /usr/lib/libboost_regex.a /usr/lib/libboost_regex.so.1.31.0 /usr/lib/libboost_regex.so.1 I have a small file named 'foo.cpp' containing the following: int main() { return 0; } When I try the following: g++ foo.cpp -L/usr/lib -lboost_regex everthing works fine. But when I do this: g++ foo.cpp -L/usr/lib -lboost_thread I get: /usr/bin/ld: cannot find -lboost_thread collect2: ld returned 1 exit status When removing /usr/lib/libboost_regex.a I get the same error as above when trying to 'g++ foo.cpp -L/usr/lib -lboost_regex'. I was under the impression that g++ would look for shared librarires and try to link againt them first and if that didn't work try to link againt static libraries. Perhaps this is not tha case? Can someone enlighten me on this, probalbly trivial, issue? Thanks in advance! :.:: mattias PS. > g++ -v foo.cpp -L/usr/lib -lboost_thread Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SOURCE foo.cpp -D__GNUG__=3 -quiet -dumpbase foo.cpp -auxbase foo -version -o /tmp/cccCYtHd.s GNU C++ version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) (i386-redhat-linux) compiled by GNU C version 3.3.3 20040412 (Red Hat Linux 3.3.3-7). GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64549 ignoring nonexistent directory "/usr/i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/include/c++/3.3.3 /usr/include/c++/3.3.3/i386-redhat-linux /usr/include/c++/3.3.3/backward /usr/local/include /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include /usr/include End of search list. as -V -Qy -o /tmp/ccqqpjhi.o /tmp/cccCYtHd.s GNU assembler version 2.15.90.0.3 (i386-redhat-linux) using BFD version 2.15.90.0.3 20040415 /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crt1.o /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crti.o /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtbegin.o -L/usr/lib -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3 -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../.. /tmp/ccqqpjhi.o -lboost_thread -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtend.o /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crtn.o /usr/bin/ld: cannot find -lboost_thread collect2: ld returned 1 exit status From eljay@adobe.com Mon Aug 9 17:10:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 09 Aug 2004 17:10:00 -0000 Subject: Confused about linking References: <41179843.5010404@brasse.org> Message-ID: <02c201c47e2a$b7e4fc20$79b2f882@PS253> Hi Mattias, Try this... cd /usr/lib ln -s libboost_thread.so.1 libboost_thread.so ln -s libboost_regex.so.1 libboost_regex.so Then see if it links. Otherwise, try putting in the fully qualified pathname: g++ foo.cpp /usr/bin/libboost_regex.so.1 /usr/bin/libboost_thread.so.1 HTH, --Eljay From ankitjain1580@yahoo.com Mon Aug 9 17:23:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 17:23:00 -0000 Subject: sorry again:)->extended asm problem In-Reply-To: <200408091720.17349.pluto@pld-linux.org> Message-ID: <20040809163330.26329.qmail@web52903.mail.yahoo.com> hi thanks a lot :) but i wanted to do it through pointers? i am not able to understand why it cant happen with pointers? what u told is fine except i could not understand "volaitle"? thanks ankit --- Pawe? ??_Sikora wrote: > # gcc -s -O2 mmx.c > > # ./a.out > 1 2 3 4 5 6 7 8 > 1 2 3 4 5 6 7 8 > > > -- > /* Copyright (C) 2003, SCO, Inc. This is valuable > Intellectual Property. */ > > #define say(x) lie(x) > > #include > #include > > uint8_t a[8] = { 1, 2, 3, 4, 5, 6, 7, 8}, > b[8] = { 0, 0, 0, 0, 0, 0, 0, 0}; > > int main() > { > int i; > for(i = 0; i < 8; i++) > printf("%d ",a[i]); > printf("\n"); > > asm volatile ( > "movq (%0), %%mm0 \n\t" > "movq %%mm0, (%1) \n\t" > : // outputs > : "r"(a), "r" (b) // inputs > : "mm0" // clobbers > ); > > for(i = 0; i < 8; i++) > printf("%d ",b[i]); > printf("\n"); > return 0; > } > ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From ankitjain1580@yahoo.com Mon Aug 9 17:33:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 17:33:00 -0000 Subject: problem in extended asm Message-ID: <20040809171020.61634.qmail@web52901.mail.yahoo.com> hi a simple question: why the followinf instruction dosent work in gcc for(i=0;i<8;i++) { asm("movq i(%1),%%mm0 \n" "movq %%mm0,(%0) :"=r"(x) :"r"(m)); //m is an array } for(i=0;i<8;i++) printf("%d",x[i]) thanks ankit jain ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From zack@codesourcery.com Mon Aug 9 18:14:00 2004 From: zack@codesourcery.com (Zack Weinberg) Date: Mon, 09 Aug 2004 18:14:00 -0000 Subject: problem in extended asm In-Reply-To: <20040809171020.61634.qmail@web52901.mail.yahoo.com> (Ankit Jain's message of "Mon, 9 Aug 2004 18:10:20 +0100 (BST)") References: <20040809171020.61634.qmail@web52901.mail.yahoo.com> Message-ID: <873c2wuswl.fsf@codesourcery.com> Ankit Jain writes: > hi > > a simple question: why the followinf instruction > dosent work in gcc > for(i=0;i<8;i++) > { > asm("movq i(%1),%%mm0 \n" > "movq %%mm0,(%0) > :"=r"(x) > :"r"(m)); //m is an array > } > for(i=0;i<8;i++) > printf("%d",x[i]) This sort of question is appropriate for gcc-help only; cc: adjusted. We cannot tell you exactly what is wrong when you provide only a code fragment like this. However, I can tell you right now that referring to "i" directly in the assembler, as you have done, does not work. You need to treat _all_ variables as operands. Also you forgot to clobber mm0. And did you really mean to index the access to x, but not m? I suspect (but cannot be sure, since you did not provide a complete test case) that what you really want to write is something like asm ("movq %1,%%mm0\n\t" "movq %%mm0, %0" : "=m" (x[i]) : "m" (m[i]) : "mm0"); If you really meant to index only x, not m, then you can write this even simpler: asm ("movq %1,%0" : "=m" (x[i]) : "y" (m[0])); (a "y" constraint puts the value in an MMX register). zw From dk@artimi.com Mon Aug 9 22:04:00 2004 From: dk@artimi.com (Dave Korn) Date: Mon, 09 Aug 2004 22:04:00 -0000 Subject: problem in extended asm In-Reply-To: <20040809171020.61634.qmail@web52901.mail.yahoo.com> Message-ID: > -----Original Message----- > From: gcc-owner On Behalf Of Ankit Jain > Sent: 09 August 2004 18:10 > hi > > a simple question: why the followinf instruction > dosent work in gcc > for(i=0;i<8;i++) > { > asm("movq i(%1),%%mm0 \n" > "movq %%mm0,(%0) > :"=r"(x) > :"r"(m)); //m is an array > } You forgot a closing quote. cheers, DaveK -- Can't think of a witty .sigline today.... From ankitjain1580@yahoo.com Mon Aug 9 22:48:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Mon, 09 Aug 2004 22:48:00 -0000 Subject: problem in extended asm In-Reply-To: Message-ID: <20040809181418.54547.qmail@web52909.mail.yahoo.com> no not a question of closing quote consider if it is there --- Dave Korn wrote: > > -----Original Message----- > > From: gcc-owner On Behalf Of Ankit Jain > > Sent: 09 August 2004 18:10 > > > hi > > > > a simple question: why the followinf instruction > > dosent work in gcc > > for(i=0;i<8;i++) > > { > > asm("movq i(%1),%%mm0 \n" > > "movq %%mm0,(%0) > > :"=r"(x) > > :"r"(m)); //m is an array > > } > > You forgot a closing quote. > > > cheers, > DaveK > -- > Can't think of a witty .sigline today.... > > ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From jeff.holle@verizon.net Mon Aug 9 22:54:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Mon, 09 Aug 2004 22:54:00 -0000 Subject: question about anonymous union usage Message-ID: I'm using g++ v3.4.1. I'm considering using an anonymous union in the following fashion: class SomeClass { .... private: bool isPseudo_; union { LayoutVertex *layoutVertex_; PseudoVertex *pseudoVertex_; }; } Both LayoutVertex and PseudoVertex have the same methods. Only in the constructors of SomeClass will I have to code in a way that differenciates between layoutVertex_ and psuedoVertex_. My question is can I safely use layoutVertex_ elsewhere even if its initialized with a PsuedoVertex object? From ishwar@pali.cps.cmich.edu Tue Aug 10 00:23:00 2004 From: ishwar@pali.cps.cmich.edu (Ishwar Rattan) Date: Tue, 10 Aug 2004 00:23:00 -0000 Subject: Confused about linking In-Reply-To: <41179843.5010404@brasse.org> References: <41179843.5010404@brasse.org> Message-ID: -lxx implies that libxx.a exists in the specified path, has nothing to do with shared libraries. Install libboost-thread first! -ishwar On Mon, 9 Aug 2004, [ISO-8859-1] Mattias Br?ndstr?m wrote: > Hello! > > I am seriously confused when it comes to linking my executable written > in C++. More specificaly I want to link againts boost_thread and > boost_regex on a Fedora 2 system. > > These files are located in /usr/lib: > > /usr/lib/libboost_thread.so.1 > /usr/lib/libboost_thread.so.1.31.0 > /usr/lib/libboost_regex.a > /usr/lib/libboost_regex.so.1.31.0 > /usr/lib/libboost_regex.so.1 > > I have a small file named 'foo.cpp' containing the following: > > int main() > { > return 0; > } > > When I try the following: > > g++ foo.cpp -L/usr/lib -lboost_regex > > everthing works fine. But when I do this: > > g++ foo.cpp -L/usr/lib -lboost_thread > > I get: > > /usr/bin/ld: cannot find -lboost_thread > collect2: ld returned 1 exit status > > When removing /usr/lib/libboost_regex.a I get the same error as above > when trying to 'g++ foo.cpp -L/usr/lib -lboost_regex'. > > I was under the impression that g++ would look for shared librarires and > try to link againt them first and if that didn't work try to link againt > static libraries. Perhaps this is not tha case? Can someone enlighten me > on this, probalbly trivial, issue? > > Thanks in advance! > > :.:: mattias > > PS. > > g++ -v foo.cpp -L/usr/lib -lboost_thread > > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man > --infodir=/usr/share/info --enable-shared --enable-threads=posix > --disable-checking --disable-libunwind-exceptions --with-system-zlib > --enable-__cxa_atexit --host=i386-redhat-linux > Thread model: posix > gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/cc1plus -quiet -v > -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SOURCE > foo.cpp -D__GNUG__=3 -quiet -dumpbase foo.cpp -auxbase foo -version -o > /tmp/cccCYtHd.s > GNU C++ version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) (i386-redhat-linux) > compiled by GNU C version 3.3.3 20040412 (Red Hat Linux 3.3.3-7). > GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64549 > ignoring nonexistent directory "/usr/i386-redhat-linux/include" > #include "..." search starts here: > #include <...> search starts here: > /usr/include/c++/3.3.3 > /usr/include/c++/3.3.3/i386-redhat-linux > /usr/include/c++/3.3.3/backward > /usr/local/include > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include > /usr/include > End of search list. > as -V -Qy -o /tmp/ccqqpjhi.o /tmp/cccCYtHd.s > GNU assembler version 2.15.90.0.3 (i386-redhat-linux) using BFD version > 2.15.90.0.3 20040415 > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/collect2 --eh-frame-hdr -m > elf_i386 -dynamic-linker /lib/ld-linux.so.2 > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crt1.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crti.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtbegin.o -L/usr/lib > -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3 > -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../.. /tmp/ccqqpjhi.o > -lboost_thread -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtend.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crtn.o > /usr/bin/ld: cannot find -lboost_thread > collect2: ld returned 1 exit status > From lrtaylor@micron.com Tue Aug 10 02:17:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Tue, 10 Aug 2004 02:17:00 -0000 Subject: Confused about linking Message-ID: <363801FFD7B74240A329CEC3F7FE4CC40215DBA7@ntxboimbx07.micron.com> No, that is not right. If you look at his file listing, he obviously does have libboost_thread installed. -lxx causes the linker to look first for libxx.so and then libxx.a, unless you override that default by specifying the appropriate actions. In this case, with -lboost_thread, it's going to look for libboost_thread.so and then libboost_thread.a. However, neither of them exists - instead, you have libboost_thread.so.1. Create a symbolic link in /usr/lib named libboost_thread.so to libboost_thread.so.1, and you should be OK. For example, execute the following commands: su (must be logged in as root) cd /usr/bin ln -s libboost_thread.so.1 libboost_thread.so Cheers, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Ishwar Rattan Sent: Monday, August 09, 2004 4:51 PM To: Mattias Br?ndstr?m Cc: gcc-help@gcc.gnu.org Subject: Re: Confused about linking -lxx implies that libxx.a exists in the specified path, has nothing to do with shared libraries. Install libboost-thread first! -ishwar On Mon, 9 Aug 2004, [ISO-8859-1] Mattias Br?ndstr?m wrote: > Hello! > > I am seriously confused when it comes to linking my executable written > in C++. More specificaly I want to link againts boost_thread and > boost_regex on a Fedora 2 system. > > These files are located in /usr/lib: > > /usr/lib/libboost_thread.so.1 > /usr/lib/libboost_thread.so.1.31.0 > /usr/lib/libboost_regex.a > /usr/lib/libboost_regex.so.1.31.0 > /usr/lib/libboost_regex.so.1 > > I have a small file named 'foo.cpp' containing the following: > > int main() > { > return 0; > } > > When I try the following: > > g++ foo.cpp -L/usr/lib -lboost_regex > > everthing works fine. But when I do this: > > g++ foo.cpp -L/usr/lib -lboost_thread > > I get: > > /usr/bin/ld: cannot find -lboost_thread > collect2: ld returned 1 exit status > > When removing /usr/lib/libboost_regex.a I get the same error as above > when trying to 'g++ foo.cpp -L/usr/lib -lboost_regex'. > > I was under the impression that g++ would look for shared librarires and > try to link againt them first and if that didn't work try to link againt > static libraries. Perhaps this is not tha case? Can someone enlighten me > on this, probalbly trivial, issue? > > Thanks in advance! > > :.:: mattias > > PS. > > g++ -v foo.cpp -L/usr/lib -lboost_thread > > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man > --infodir=/usr/share/info --enable-shared --enable-threads=posix > --disable-checking --disable-libunwind-exceptions --with-system-zlib > --enable-__cxa_atexit --host=i386-redhat-linux > Thread model: posix > gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/cc1plus -quiet -v > -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SOURCE > foo.cpp -D__GNUG__=3 -quiet -dumpbase foo.cpp -auxbase foo -version -o > /tmp/cccCYtHd.s > GNU C++ version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) (i386-redhat-linux) > compiled by GNU C version 3.3.3 20040412 (Red Hat Linux 3.3.3-7). > GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64549 > ignoring nonexistent directory "/usr/i386-redhat-linux/include" > #include "..." search starts here: > #include <...> search starts here: > /usr/include/c++/3.3.3 > /usr/include/c++/3.3.3/i386-redhat-linux > /usr/include/c++/3.3.3/backward > /usr/local/include > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include > /usr/include > End of search list. > as -V -Qy -o /tmp/ccqqpjhi.o /tmp/cccCYtHd.s > GNU assembler version 2.15.90.0.3 (i386-redhat-linux) using BFD version > 2.15.90.0.3 20040415 > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/collect2 --eh-frame-hdr -m > elf_i386 -dynamic-linker /lib/ld-linux.so.2 > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crt1.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crti.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtbegin.o -L/usr/lib > -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3 > -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../.. /tmp/ccqqpjhi.o > -lboost_thread -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/crtend.o > /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../crtn.o > /usr/bin/ld: cannot find -lboost_thread > collect2: ld returned 1 exit status > From laflynn@lucent.com Tue Aug 10 07:15:00 2004 From: laflynn@lucent.com (Flynn, Lori Arline (Lori)) Date: Tue, 10 Aug 2004 07:15:00 -0000 Subject: SSA code debugging Message-ID: <9B457B1322AAAE46BD5E693C02842C1D030D2853@nj0117exch002u.wh.lucent.com> Hi, >From an SSA-labelled source line, I'd like to find that particular SSA-labeled variable in the object code. Is that possible? Thanks, in advance, for help! -Lori From bernie@develer.com Tue Aug 10 08:08:00 2004 From: bernie@develer.com (Bernardo Innocenti) Date: Tue, 10 Aug 2004 08:08:00 -0000 Subject: problem in extended asm In-Reply-To: References: Message-ID: <4117BEAC.5050307@develer.com> Dave Korn wrote: >>-----Original Message----- >>From: gcc-owner On Behalf Of Ankit Jain >>Sent: 09 August 2004 18:10 > > >>hi >> >>a simple question: why the followinf instruction >>dosent work in gcc >>for(i=0;i<8;i++) >>{ >>asm("movq i(%1),%%mm0 \n" >> "movq %%mm0,(%0) >> :"=r"(x) >> :"r"(m)); //m is an array >>} > > You forgot a closing quote. And a \t after the \n. Without it, the second movq would start at the beginning of the line and be interpreted as a label by the assembler. -- // Bernardo Innocenti - Develer S.r.l., R&D dept. \X/ http://www.develer.com/ From thebrasse@brasse.org Tue Aug 10 09:00:00 2004 From: thebrasse@brasse.org (=?ISO-8859-1?Q?Mattias_Br=E4ndstr=F6m?=) Date: Tue, 10 Aug 2004 09:00:00 -0000 Subject: Confused about linking In-Reply-To: <363801FFD7B74240A329CEC3F7FE4CC40215DBA7@ntxboimbx07.micron.com> References: <363801FFD7B74240A329CEC3F7FE4CC40215DBA7@ntxboimbx07.micron.com> Message-ID: <4118761B.7070801@brasse.org> lrtaylor@micron.com wrote: > -lxx causes the linker to look first for libxx.so and then libxx.a, unless you override that default by specifying the appropriate actions. In this case, with -lboost_thread, it's going to look for libboost_thread.so and then libboost_thread.a. However, neither of them exists - instead, you have libboost_thread.so.1. Create a symbolic link in /usr/lib named libboost_thread.so to libboost_thread.so.1, and you should be OK. > > For example, execute the following commands: > > su (must be logged in as root) > cd /usr/bin > ln -s libboost_thread.so.1 libboost_thread.so > Thanks everyone! When creating the symbolic link everything works fine! Now why didn't I try that in the first place? =) :.:: mattias From zzz@anda.ru Tue Aug 10 10:34:00 2004 From: zzz@anda.ru (Denis Zaitsev) Date: Tue, 10 Aug 2004 10:34:00 -0000 Subject: problem in extended asm In-Reply-To: <4117BEAC.5050307@develer.com>; from bernie@develer.com on Mon, Aug 09, 2004 at 08:13:00PM +0200 References: <4117BEAC.5050307@develer.com> Message-ID: <20040810140818.D5885@natasha.ward.six> On Mon, Aug 09, 2004 at 08:13:00PM +0200, Bernardo Innocenti wrote: > > > Dave Korn wrote: > >>-----Original Message----- > >>From: gcc-owner On Behalf Of Ankit Jain > >>Sent: 09 August 2004 18:10 > > > > > >>hi > >> > >>a simple question: why the followinf instruction > >>dosent work in gcc > >>for(i=0;i<8;i++) > >>{ > >>asm("movq i(%1),%%mm0 \n" > >> "movq %%mm0,(%0) > >> :"=r"(x) > >> :"r"(m)); //m is an array > >>} > > > > You forgot a closing quote. > > And a \t after the \n. Without it, the second movq would > start at the beginning of the line and be interpreted as > a label by the assembler. It's not true. It will be interpreted correctly. At least, for the x86 assembler. From rinku_ques@yahoo.com Tue Aug 10 10:38:00 2004 From: rinku_ques@yahoo.com (rinku rathore) Date: Tue, 10 Aug 2004 10:38:00 -0000 Subject: problem: "segmentation fault" Message-ID: <20040810085601.86326.qmail@web61205.mail.yahoo.com> hello, I had made a program to read a file and storing its contents in two dimensional array of 256*256,and a error "segmentation fault" occured how can I remove it plz tell. Rinku Rathore __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail From djp@cs.uvic.ca Tue Aug 10 10:56:00 2004 From: djp@cs.uvic.ca (David Pereira) Date: Tue, 10 Aug 2004 10:56:00 -0000 Subject: Building GCC on a Mac OS X machine Message-ID: Hello, I was wondering whether it is possible to build gcc-3.4.1 from scratch (pristine sources from gcc.gnu.org) on OS X. 1. Does it build properly without hassle ? Does it work, once built ? 2. More precisely, are all the prerequisite programs for the build process listed at http://gcc.gnu.org/install/prerequisites.html available and functional on OS X. 3. Does it build reasonably quickly ? 4. Apart from just building properly and running, does it produce correct object files/executables/shared libraries for OS X ? 5. Is any part of GCC broken with respect to OS X ? The crux of the matter is "I will be doing development of GCC with GCC on an OS X machine. I do not want to purchase an OS X machine only to find that the afore-mentioned objective cannot be fulfilled." In particular, the existence of the apple-provided version of the gcc compiler is pretty much immaterial to me --- I shall use it only for the initial build of the gcc.gnu.org sources. Hoping to hear from people who have built GCC on their OS X machines, preferrably even those are actively developing the GCC compiler itself on OS X. Can GCC (pristine gcc.gnu.org sources) "shake, rattle and roll" on OS X ? Thanks. David. From andrea_pretto@yahoo.it Tue Aug 10 11:53:00 2004 From: andrea_pretto@yahoo.it (Andrea Pretto) Date: Tue, 10 Aug 2004 11:53:00 -0000 Subject: gcc LALR? In-Reply-To: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> References: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> Message-ID: <1092138105.723.6.camel@debian-host> The Gcc parser is a LALR grammar file for Bison, which is a LALR parser generator. Therefore, if you want to say that, gcc is LALR. On Mon, 2004-08-09 at 16:10, Flynn, Lori Arline (Lori) wrote: > Hi, > > Does anybody know if gcc is LALR, LR, or LL? I can't find documentation on this. > > Thanks, > Lori From fw@deneb.enyo.de Tue Aug 10 11:58:00 2004 From: fw@deneb.enyo.de (Florian Weimer) Date: Tue, 10 Aug 2004 11:58:00 -0000 Subject: gcc LALR? In-Reply-To: <1092138105.723.6.camel@debian-host> (Andrea Pretto's message of "Tue, 10 Aug 2004 13:41:45 +0200") References: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> <1092138105.723.6.camel@debian-host> Message-ID: <87vffr2rdl.fsf@deneb.enyo.de> * Andrea Pretto: > The Gcc parser is a LALR grammar file for Bison, which is a LALR > parser generator. GCC includes various parsers. The C++ and Ada parsers are hand-written recursive descent parsers. From eljay@adobe.com Tue Aug 10 14:02:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 10 Aug 2004 14:02:00 -0000 Subject: question about anonymous union usage References: Message-ID: <002301c47ed0$a9f80e80$13b2f882@PS253> Hi Jeff, Do you mean use the layoutVertex_ the pointer member variable in SomeClass elsewhere? Or use the layoutVertex_ thing-pointed-to (but is really a pseudoVertex_) elsewhere? --Eljay From eljay@adobe.com Tue Aug 10 14:07:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 10 Aug 2004 14:07:00 -0000 Subject: problem: "segmentation fault" References: <20040810085601.86326.qmail@web61205.mail.yahoo.com> Message-ID: <005201c47ed1$5a792550$13b2f882@PS253> Hi Rinku, Please provide a short coding example that reproduces the problem. Thanks, --ELjay From jeff.holle@verizon.net Tue Aug 10 14:10:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Tue, 10 Aug 2004 14:10:00 -0000 Subject: question about anonymous union usage In-Reply-To: <002301c47ed0$a9f80e80$13b2f882@PS253> References: <002301c47ed0$a9f80e80$13b2f882@PS253> Message-ID: The later. I will have isPseudo_ properly set to identify what type of pointer the union holds, but I want to ignore it in all SomeClass methods except its constructors. If I do this, there will be times that layoutVertex_ will point to a type of PseudoVertex and I'll treat it like a LayoutVertex. Again, all methods of LayoutVertex and pseudoVertex are the same. Eljay Love-Jensen wrote: > Hi Jeff, > > Do you mean use the layoutVertex_ the pointer member variable in SomeClass > elsewhere? > > Or use the layoutVertex_ thing-pointed-to (but is really a pseudoVertex_) > elsewhere? > > --Eljay > > From andrea_pretto@yahoo.it Tue Aug 10 17:17:00 2004 From: andrea_pretto@yahoo.it (Andrea Pretto) Date: Tue, 10 Aug 2004 17:17:00 -0000 Subject: gcc LALR? In-Reply-To: <87vffr2rdl.fsf@deneb.enyo.de> References: <9B457B1322AAAE46BD5E693C02842C1D02FE074C@nj0117exch002u.wh.lucent.com> <1092138105.723.6.camel@debian-host> <87vffr2rdl.fsf@deneb.enyo.de> Message-ID: <1092150643.2581.2.camel@debian-host> On Tue, 2004-08-10 at 12:56, Florian Weimer wrote: > * Andrea Pretto: > > > The Gcc parser is a LALR grammar file for Bison, which is a LALR > > parser generator. > > GCC includes various parsers. The C++ and Ada parsers are > hand-written recursive descent parsers. Yes , right. I understood the C parser. From eljay@adobe.com Tue Aug 10 22:00:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 10 Aug 2004 22:00:00 -0000 Subject: question about anonymous union usage References: <002301c47ed0$a9f80e80$13b2f882@PS253> Message-ID: <017201c47ee3$ca5e9a50$13b2f882@PS253> Hi Jeff, > I will have isPseudo_ properly set to identify what type of pointer the union holds, but I want to ignore it in all SomeClass methods except its constructors. You should check for it in all SomeClass methods, and do things like: void SomeClass::doDance() { if(isPseudo_) pseudoVertex_->doDance(); else layoutVertex_->doDance(); }; > If I do this, there will be times that layoutVertex_ will point to a type of PseudoVertex and I'll treat it like a LayoutVertex. Then there will be times when the SomeClass object will have a pointer to PseudoVertex and you'll call the methods as if you had a pointer to LayoutVertex. Antics and hijinks ensue. HTH, --Eljay From lrtaylor@micron.com Wed Aug 11 00:13:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Wed, 11 Aug 2004 00:13:00 -0000 Subject: problem: "segmentation fault" Message-ID: <363801FFD7B74240A329CEC3F7FE4CC403096088@ntxboimbx07.micron.com> Rinku, First you need to figure out where it happened. When you build your program, add -g to the compiler options if it's not already there. That causes it to generate debugging information. When your program crashes it should create a core file. That file should either be named "core", or "core.nnnn", where "nnnn" is replaced with the process ID of the program that crashed, for example, "core.1234". You can use the GNU debugger "gdb" to examine the stack and see what line of code your program crashed on. For example, if your program is named my_prog, and your core file is just "core", you can open the core file in gdb like this: gdb my_prog core Then, you can look at the stack trace by typing "where" at the prompt. Look at the first line of the output and see if it tells you what line of your source code the error occurred on, and go back and see if you can see anything wrong with that line of code. Good luck! Cheers, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of rinku rathore Sent: Tuesday, August 10, 2004 2:56 AM To: gcc-help@gcc.gnu.org Subject: problem: "segmentation fault" hello, I had made a program to read a file and storing its contents in two dimensional array of 256*256,and a error "segmentation fault" occured how can I remove it plz tell. Rinku Rathore __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail From pkoning@equallogic.com Wed Aug 11 01:34:00 2004 From: pkoning@equallogic.com (Paul Koning) Date: Wed, 11 Aug 2004 01:34:00 -0000 Subject: problem in extended asm References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> Message-ID: <16665.17765.539593.671110@gargle.gargle.HOWL> >>>>> "Denis" == Denis Zaitsev writes: Denis> On Mon, Aug 09, 2004 at 08:13:00PM +0200, Bernardo Innocenti Denis> wrote: >> >> >> Dave Korn wrote: >>-----Original Message----- >>From: gcc-owner On >> Behalf Of Ankit Jain >>Sent: 09 August 2004 18:10 >> > >> > >> >>hi >> >> >> >>a simple question: why the followinf instruction >>dosent work >> in gcc >>for(i=0;i<8;i++) >>{ >>asm("movq i(%1),%%mm0 \n" >> "movq >> %%mm0,(%0) >> :"=r"(x) >> :"r"(m)); //m is an array >>} >> > >> > You forgot a closing quote. >> >> And a \t after the \n. Without it, the second movq would start at >> the beginning of the line and be interpreted as a label by the >> assembler. Denis> It's not true. It will be interpreted correctly. At least, Denis> for the x86 assembler. The same goes for many other assemblers. It depends on the syntax rules -- some assemblers believe that a token in column 1 is a label, some believe a token must be followed by colon (and often doesn't have to be in column 1) to be a label. GAS appears to be one such. paul From schwab@suse.de Wed Aug 11 06:35:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Wed, 11 Aug 2004 06:35:00 -0000 Subject: problem in extended asm In-Reply-To: <16665.17765.539593.671110@gargle.gargle.HOWL> (Paul Koning's message of "Tue, 10 Aug 2004 18:00:05 -0400") References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> <16665.17765.539593.671110@gargle.gargle.HOWL> Message-ID: Paul Koning writes: > The same goes for many other assemblers. It depends on the syntax > rules -- some assemblers believe that a token in column 1 is a label, > some believe a token must be followed by colon (and often doesn't have > to be in column 1) to be a label. GAS appears to be one such. Unless it is used in MRI-compatibility mode. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From linux@rochester.rr.com Wed Aug 11 08:38:00 2004 From: linux@rochester.rr.com (Marty Leisner) Date: Wed, 11 Aug 2004 08:38:00 -0000 Subject: using #ident or #pragma ident Message-ID: <200408110133.i7B1Xgl3002376@dell.home> Eljay Love-Jensen writes on Mon, 09 Aug 2004 07:08:19 CDT > Hi Marty, > > Try: > #ident "This is an ident" > And don't forget the -fident switch on your compile line. > > --Eljay 3.3.2 worked, 3.4.0 started to have problems.... 3.4.0 gives a parse error: : leisner@soyata;gcc-3.4.0 -save-temps -s foo.c foo.c:1:10: warning: extra tokens at end of #ident directive marty From ankitjain1580@yahoo.com Wed Aug 11 08:52:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Wed, 11 Aug 2004 08:52:00 -0000 Subject: problem with pointers in asm Message-ID: <20040811063556.44421.qmail@web52907.mail.yahoo.com> hi well i want to understand how assembler treats pointers? my code is: 1 #include 2 3 4 int main() 5 { 6 uint8_t a[8]={1,2,3,4,5,6,7,8},b[8]={0,0,0,0,0,0},i; 7 uint8_t *m,*m1; 8 9 m=a; 10 m1=b; //i have pointed m1 to b 11 for(i=0;i<8;i++) 12 printf("%d ",a[i]); 13 printf("\n"); 14 asm("movq (%1), %%mm0 \n" 15 "movq %%mm0, (%0) \n" 16 :"=r"(m1) 17 :"r"(m) 18 ); 19 20 for(i=0;i<8;i++) 21 printf("%d ",b[i]); 22 return 0; 23 } well this problem is not solved yet. because when i display b array then it prints all 0's. according to me since i have initialised this m1 pointer then by b then b whould have all the values which i have moved some have advised me to use arrays here as constraint but i want to use pointers. i am using r constraint and it says it says that m1 will use a register (i guess there is no problem in that) what is the complete problem HOW THIS ASSEMBLER IS TREATING THIS POINTER m1? thanks ankit jain ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From ankitjain1580@yahoo.com Wed Aug 11 09:04:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Wed, 11 Aug 2004 09:04:00 -0000 Subject: problem with pointers in asm In-Reply-To: <20040811080658.GA10320@login-4.efd.lth.se> Message-ID: <20040811083853.19662.qmail@web52903.mail.yahoo.com> thanks but still i am not clear how m1 is input to asm()? and if u can explain this " "memory" since your asm() changes memory." thanks ankit --- Fredrik Olofsson wrote: > On Wed, Aug 11, 2004 at 07:35:56AM +0100, Ankit Jain > wrote: > > 14 asm("movq (%1), %%mm0 \n" > > 15 "movq %%mm0, (%0) \n" > > 16 :"=r"(m1) > > 17 :"r"(m) > > 18 ); > > m1 is used as an input to the asm(), so adding > "r"(m1) to line 17 and removing it from line 16 > fixes the problem. Probably you should also add a > line 17.5 : "memory" since your asm() changes > memory. > > asm("movq (%1), %%mm0 \n" > "movq %%mm0, (%0) \n" > : > : "r"(m1), "r"(m) > : "memory" > ); > > Cheers, > /Fredrik > ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From amrith.chandri@oracle.com Wed Aug 11 09:31:00 2004 From: amrith.chandri@oracle.com (amrith chandri) Date: Wed, 11 Aug 2004 09:31:00 -0000 Subject: Hidden symbols Message-ID: Hi , I have seen some symbols in the symbol table are attributed as .HIDDEN, sometimes while linking with these libraries, i am getting the Hidden symbol issue from ld and ld exits. Can anyone explain, why this hidden symbol is used ? and any work around link against the hidden symbols. thanks amrith From dk@artimi.com Wed Aug 11 10:26:00 2004 From: dk@artimi.com (Dave Korn) Date: Wed, 11 Aug 2004 10:26:00 -0000 Subject: problem in extended asm In-Reply-To: <20040810140818.D5885@natasha.ward.six> Message-ID: > -----Original Message----- > From: Denis Zaitsev [mailto:zzz@anda.ru] > Sent: 10 August 2004 09:08 > To: Bernardo Innocenti > Cc: Dave Korn; 'gcc'; 'gcc' > Subject: Re: problem in extended asm > > On Mon, Aug 09, 2004 at 08:13:00PM +0200, Bernardo Innocenti wrote: > > > > > > Dave Korn wrote: > > >>-----Original Message----- > > >>From: gcc-owner On Behalf Of Ankit Jain > > >>Sent: 09 August 2004 18:10 > > > > > > > > >>hi > > >> > > >>a simple question: why the followinf instruction > > >>dosent work in gcc > > >>for(i=0;i<8;i++) > > >>{ > > >>asm("movq i(%1),%%mm0 \n" > > >> "movq %%mm0,(%0) > > >> :"=r"(x) > > >> :"r"(m)); //m is an array > > >>} > > > > > > You forgot a closing quote. > > > > And a \t after the \n. Without it, the second movq would > > start at the beginning of the line and be interpreted as > > a label by the assembler. > > It's not true. It will be interpreted correctly. At least, for the > x86 assembler. OK then, is it because it writes to the output before consuming all the inputs? "Unless an output operand has the '&' constraint modifier, GCC may allocate it in the same register as an unrelated input operand, on the assumption the inputs are consumed before the outputs are produced. This assumption may be false if the assembler code actually consists of more than one instruction. In such a case, use '&' for each output operand that may not overlap an input. See Section 5.36.4 [Modifiers], page 225." cheers, DaveK -- Can't think of a witty .sigline today.... From dk@artimi.com Wed Aug 11 12:47:00 2004 From: dk@artimi.com (Dave Korn) Date: Wed, 11 Aug 2004 12:47:00 -0000 Subject: problem in extended asm In-Reply-To: Message-ID: > -----Original Message----- > From: gcc-owner On Behalf Of Dave Korn > Sent: 11 August 2004 10:03 > > > >>for(i=0;i<8;i++) > > > >>{ > > > >>asm("movq i(%1),%%mm0 \n" > > > >> "movq %%mm0,(%0) > > > >> :"=r"(x) > > > >> :"r"(m)); //m is an array > > > >>} > > OK then, is it because it writes to the output before > consuming all the inputs? D'oh. Not in that non-intel syntax it doesn't. Ignore that last post, please..... cheers, DaveK -- Can't think of a witty .sigline today.... From vibhaakarsharma@yahoo.com Wed Aug 11 14:37:00 2004 From: vibhaakarsharma@yahoo.com (Vibhaakar Sharma) Date: Wed, 11 Aug 2004 14:37:00 -0000 Subject: Steps required for gcc compilation.. Message-ID: <20040811102652.14257.qmail@web40601.mail.yahoo.com> Hi, I am new to compiling gcc. Can anyone point me what are exact steps to compile gcc my-self. What is difference while cross-compiling it for AMD64/IA64. And which library/component is responsible for generating format i.e. ELF or PE-COFF. Thanks, -Vibhaakar. __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail From eljay@adobe.com Wed Aug 11 18:45:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Wed, 11 Aug 2004 18:45:00 -0000 Subject: Steps required for gcc compilation.. References: <20040811102652.14257.qmail@web40601.mail.yahoo.com> Message-ID: <017401c47fa1$4a9e3140$6eb2f882@PS253> Hi Vibhaakar, > I am new to compiling gcc. Can anyone point me what are exact steps to compile gcc my-self. http://gcc.gnu.org/install/ > What is difference while cross-compiling it for AMD64/IA64. I do not know. > And which library/component is responsible for generating format i.e. ELF or PE-COFF. I do not know. HTH, --Eljay From michal017@centrum.sk Wed Aug 11 19:24:00 2004 From: michal017@centrum.sk (m.) Date: Wed, 11 Aug 2004 19:24:00 -0000 Subject: precompiled headers usage Message-ID: <411A2F0A.2020505@centrum.sk> How do I know whether a precompiled header was used during compilation of a .cc unit? I used -H switch but it was not listed, however the original header file that was used to generate the .h.gch precompiled header was there.. thanks. m. From zzz@anda.ru Wed Aug 11 19:28:00 2004 From: zzz@anda.ru (Denis Zaitsev) Date: Wed, 11 Aug 2004 19:28:00 -0000 Subject: problem in extended asm In-Reply-To: ; from schwab@suse.de on Wed, Aug 11, 2004 at 02:13:09AM +0200 References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> <16665.17765.539593.671110@gargle.gargle.HOWL> Message-ID: <20040812003440.B615@natasha.ward.six> On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: > Paul Koning writes: > > > The same goes for many other assemblers. It depends on the syntax > > rules -- some assemblers believe that a token in column 1 is a label, > > some believe a token must be followed by colon (and often doesn't have > > to be in column 1) to be a label. GAS appears to be one such. > > Unless it is used in MRI-compatibility mode. What does MRI stand for? From tm_gccmail@kloo.net Wed Aug 11 20:32:00 2004 From: tm_gccmail@kloo.net (tm_gccmail@kloo.net) Date: Wed, 11 Aug 2004 20:32:00 -0000 Subject: problem in extended asm In-Reply-To: <20040812003440.B615@natasha.ward.six> Message-ID: On Thu, 12 Aug 2004, Denis Zaitsev wrote: > On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: > > Paul Koning writes: > > > > > The same goes for many other assemblers. It depends on the syntax > > > rules -- some assemblers believe that a token in column 1 is a label, > > > some believe a token must be followed by colon (and often doesn't have > > > to be in column 1) to be a label. GAS appears to be one such. > > > > Unless it is used in MRI-compatibility mode. > > What does MRI stand for? I believe it's Microtec Research, Inc. Toshi From schwab@suse.de Wed Aug 11 20:34:00 2004 From: schwab@suse.de (Andreas Schwab) Date: Wed, 11 Aug 2004 20:34:00 -0000 Subject: problem in extended asm In-Reply-To: <20040812003440.B615@natasha.ward.six> (Denis Zaitsev's message of "Thu, 12 Aug 2004 00:34:40 +0600") References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> <16665.17765.539593.671110@gargle.gargle.HOWL> <20040812003440.B615@natasha.ward.six> Message-ID: Denis Zaitsev writes: > On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: >> Paul Koning writes: >> >> > The same goes for many other assemblers. It depends on the syntax >> > rules -- some assemblers believe that a token in column 1 is a label, >> > some believe a token must be followed by colon (and often doesn't have >> > to be in column 1) to be a label. GAS appears to be one such. >> >> Unless it is used in MRI-compatibility mode. > > What does MRI stand for? *Note (as)M:: The `-M' or `--mri' option selects MRI compatibility mode. This changes the syntax and pseudo-op handling of `as' to make it compatible with the `ASM68K' or the `ASM960' (depending upon the configured target) assembler from Microtec Research. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstra??e 5, 90409 N??rnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From zzz@anda.ru Thu Aug 12 03:06:00 2004 From: zzz@anda.ru (Denis Zaitsev) Date: Thu, 12 Aug 2004 03:06:00 -0000 Subject: problem in extended asm In-Reply-To: ; from schwab@suse.de on Wed, Aug 11, 2004 at 09:28:47PM +0200 References: <4117BEAC.5050307@develer.com> <20040810140818.D5885@natasha.ward.six> <16665.17765.539593.671110@gargle.gargle.HOWL> <20040812003440.B615@natasha.ward.six> Message-ID: <20040812023237.B853@natasha.ward.six> On Wed, Aug 11, 2004 at 09:28:47PM +0200, Andreas Schwab wrote: > Denis Zaitsev writes: > > > On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: > >> Paul Koning writes: > >> > >> > The same goes for many other assemblers. It depends on the syntax > >> > rules -- some assemblers believe that a token in column 1 is a label, > >> > some believe a token must be followed by colon (and often doesn't have > >> > to be in column 1) to be a label. GAS appears to be one such. > >> > >> Unless it is used in MRI-compatibility mode. > > > > What does MRI stand for? > > *Note (as)M:: > > The `-M' or `--mri' option selects MRI compatibility mode. This changes > the syntax and pseudo-op handling of `as' to make it compatible with the > `ASM68K' or the `ASM960' (depending upon the configured target) > assembler from Microtec Research. Ok. Thanks. From zzz@anda.ru Thu Aug 12 03:32:00 2004 From: zzz@anda.ru (Denis Zaitsev) Date: Thu, 12 Aug 2004 03:32:00 -0000 Subject: problem in extended asm In-Reply-To: ; from tm_gccmail@kloo.net on Wed, Aug 11, 2004 at 12:09:54PM -0700 References: <20040812003440.B615@natasha.ward.six> Message-ID: <20040812023433.C853@natasha.ward.six> On Wed, Aug 11, 2004 at 12:09:54PM -0700, tm_gccmail@kloo.net wrote: > On Thu, 12 Aug 2004, Denis Zaitsev wrote: > > > On Wed, Aug 11, 2004 at 02:13:09AM +0200, Andreas Schwab wrote: > > > Paul Koning writes: > > > > > > > The same goes for many other assemblers. It depends on the syntax > > > > rules -- some assemblers believe that a token in column 1 is a label, > > > > some believe a token must be followed by colon (and often doesn't have > > > > to be in column 1) to be a label. GAS appears to be one such. > > > > > > Unless it is used in MRI-compatibility mode. > > > > What does MRI stand for? > > I believe it's Microtec Research, Inc. Thanks. Andreas have described that it really is. From oliver.george@dhhs.tas.gov.au Thu Aug 12 06:03:00 2004 From: oliver.george@dhhs.tas.gov.au (George Oliver) Date: Thu, 12 Aug 2004 06:03:00 -0000 Subject: best way to construct function calls at runtime? Message-ID: <76961E0EB74CE84CBA46259D2182B147030D9DC1@pc1935.dchs.tas.gov.au> Hello, What is the best way to construct function calls at runtime? I'm writing an interpreted language and want to access system/dynamic libraries. Dlsym gives me a function pointer and I have runtime declarations identifying the function arguments. But what is the right way to invoke the call? The ideal seems to be some kind of gcc library which will help me call functions based on runtime interface declarations - perhaps I'm overly hopeful but does such a beast exist? Below are the things I've experimented with, all work on x86 but have limitations and are unlikely to be very cross platform friendly. cheers, Oliver. INLINE ASSEMBLER ==================== Using inline assembly instructions (PUSH, CALL, MOV, STL) to put args on the stack, call the function and retrieve scalar or floating-point result. CON: Works great on x86 but for other processors it looks a lot more scary. CON: More complicated to handle functions returning struct/union types ALL POSSIBLE COMBINATIONS ================================ Since args are boundary aligned I could do what most other interpreters I've found do, do a switch for argcount and make a generic call for every possibility. Something like this... void** buf[siz]; //populated with vals (note that a double will fill two words) switch (siz) { case 0: res=fn(); break; case 0: res=fn(buf[0]); break; case 0: res=fn(buf[0],buf[1]); break; case 0: res=fn(buf[0],buf[1],buf[2]); break; // et al. } CON: have to repeat for different result types (scalar vs double vs struct/union) CON: seems like there should be a better way From chaoliu@uiuc.edu Thu Aug 12 06:09:00 2004 From: chaoliu@uiuc.edu (Chao Liu) Date: Thu, 12 Aug 2004 06:09:00 -0000 Subject: how to dumping out function name and its parameters from gcc's AST? Message-ID: Hi, hackers, I am now try to dump our AST from gcc 3.4.0 for c programming language. Currently, I'd like to dump out the function name and its parameters if any. For example, for a function call to the function foo like "foo(a, b, c)" , I would like "foo, a, b, c" dumped out. My instrumented code into gcc's c-decl.c is switch (TREE_CODE(expr)){ case CALL_EXPR: printf("%s", IDENTIFIER_POINTER(DECL_NAME(TREE_OPERAND(expr, 0), 0)))); tree paralist = TREE_VALUE(TREE_OPERAND(expr, 1)); tree para = TREE_CHAIN(paralist); while(para != NULL_TREE){ printf("%s", IDENTIFIER_POINTER(DECL_NAME(para))); para = TREE_CHAIN(para); } but it failed to give the correct parameter names while function name is correct. So what's wrong? I know in cases like foo(i+j, p+q), it is undefined what to dump out but just want to know in the simple case foo(i, j) how to dump foo, i, j if possible. btw, for an expression "expr" with TREE_CODE as CALL_EXPR, what is the type of TREE_OPERAND(expr, 0) and TREE_OPERAND(expr, 1); As documented in tree.def, they are function and paralist, but what are their TREE_CODES? Also, given one tree type variable, like tree tmp, how can I know its TREE_CODE? Do we have some methods to print its type out? many thanks to your patience. If you are not clear about what I mean, do let me know. thanks again, Chao From sriharsha.v@redpinesignals.com Thu Aug 12 06:38:00 2004 From: sriharsha.v@redpinesignals.com (Sriharsha Vedurmudi) Date: Thu, 12 Aug 2004 06:38:00 -0000 Subject: Seeking Guidence on Porting GCC Message-ID: <411B0A2F.7050500@redpinesignals.com> Hi, I am from a company where we have developed a new DSP-type Processor and plan to port an RTOS onto it for use with some wireless Stuff. For this, we wanted to port the GCC toolchain for our processor. We have outsourced it to another company and now, I am made incharge of it from the time it is delivered to us (means, I'd be responsible to fix any bugs that arise at later date and provide customer support for the same). Problem: I have never worked at Sub-Compiler level. Im very comfortable with C and some popular command line options of gcc and ld. Nothing much more than that (plus ofcourse using some utilities like nm etc etc). I would like some guidence from a good samaritan on the aspects of Porting GCC toolchain (What part of the entire code needs to be changed? What are the pitfalls to watch for when I receive the ported version? etc...). What I have Done: I have been Bugging Mr. Google for information regarding this, but somehow the results were not satisfactory. Then I tried looking at the source code and decided against it when my deadline arrived. Now, Im really stuck and desperately need help. Thank you in advance for any help you extend. (I'd greatly appreciate if you can atleast provide me with some links that might be useful or serve as a guide). Warm Regards, Sriharsha. -- Sriharsha Vedurmudi Software Engineer Redpine Signals Inc. ---------------------------- Gate No:395, Plot No: 87&88 Sagar Society, Road No: 2 Banjara Hills Hyderabad-500 034 Andhra Pradesh India. ---------------------------- Phone: +91 40 23550722 Mobile: +91 98491 33133 From sriharsha.v@redpinesignals.com Thu Aug 12 10:35:00 2004 From: sriharsha.v@redpinesignals.com (Sriharsha Vedurmudi) Date: Thu, 12 Aug 2004 10:35:00 -0000 Subject: Help Needed On Porting Issue Message-ID: <411B0BBE.60808@redpinesignals.com> Hi, I am from a company where we have developed a new DSP-type Processor and plan to port an RTOS onto it for use with some wireless Stuff. For this, we wanted to port the GCC toolchain for our processor. We have outsourced it to another company and now, I am made incharge of it from the time it is delivered to us (means, I'd be responsible to fix any bugs that arise at later date and provide customer support for the same). Problem: I have never worked at Sub-Compiler level. Im very comfortable with C and some popular command line options of gcc and ld. Nothing much more than that (plus ofcourse using some utilities like nm etc etc). I would like some guidence from a good samaritan on the aspects of Porting GCC toolchain (What part of the entire code needs to be changed? What are the pitfalls to watch for when I receive the ported version? etc...). What I have Done: I have been Bugging Mr. Google for information regarding this, but somehow the results were not satisfactory. Then I tried looking at the source code and decided against it when my deadline arrived. Now, Im really stuck and desperately need help. Thank you in advance for any help you extend. (I'd greatly appreciate if you can atleast provide me with some links that might be useful or serve as a guide). Warm Regards, Sriharsha. -- Sriharsha Vedurmudi Software Engineer Redpine Signals Inc. ---------------------------- Gate No:395, Plot No: 87&88 Sagar Society, Road No: 2 Banjara Hills Hyderabad-500 034 Andhra Pradesh India. ---------------------------- Phone: +91 40 23550722 Mobile: +91 98491 33133 From hueffner@informatik.uni-tuebingen.de Thu Aug 12 12:06:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Thu, 12 Aug 2004 12:06:00 -0000 Subject: best way to construct function calls at runtime? In-Reply-To: <76961E0EB74CE84CBA46259D2182B147030D9DC1@pc1935.dchs.tas.gov.au> (George Oliver's message of "Thu, 12 Aug 2004 13:00:39 +1000") References: <76961E0EB74CE84CBA46259D2182B147030D9DC1@pc1935.dchs.tas.gov.au> Message-ID: <87u0v8c13g.fsf@informatik.uni-tuebingen.de> George Oliver writes: > What is the best way to construct function calls at runtime? You can use libffi, which is part of gcc's source. It is not ported to all gcc platforms, but to most important ones. -- Falk From david@krt.neobee.net Thu Aug 12 16:16:00 2004 From: david@krt.neobee.net (Mile Davidovic) Date: Thu, 12 Aug 2004 16:16:00 -0000 Subject: Question regarding subscribing Message-ID: <000e01c48058$1330d020$5900a8c0@micronasnit.com> Hi all Please could You tell why I can not to subscribe to gcc mailing list? I tried with Mile.Davidovic@micronasnit.com but I failed? Best regards Mile From eljay@adobe.com Thu Aug 12 17:51:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 12 Aug 2004 17:51:00 -0000 Subject: Question regarding subscribing References: <000e01c48058$1330d020$5900a8c0@micronasnit.com> Message-ID: <005d01c48064$c19726d0$67b2f882@PS253> Hi Mile, Did you go here... http://gcc.gnu.org/lists.html ...and register your email address? Do you have a spam filter on your email that consumed the confirmation notice? Is your Mile.Davidovic@micronasnit.com account active? HTH, --Eljay From rs@isctem.com Thu Aug 12 23:04:00 2004 From: rs@isctem.com (Ricardo Santos) Date: Thu, 12 Aug 2004 23:04:00 -0000 Subject: Help with templates Message-ID: <411B97A8.4050607@isctem.com> I have a problem with templates. I am doing a little class (Stack) to demonstrate templates, and I have a library problem. I don't know wich library I have to compile with, to use templates... My compilation line is: g++ -o s StackAr.cpp mStackAr.cpp And the Result of that command is: /home/rs/tmp/cc0KjPdZ.o(.text+0x1c): In function `main': : undefined reference to `StackAr::StackAr[in-charge]()' /home/rs/tmp/cc0KjPdZ.o(.text+0x36): In function `main': : undefined reference to `StackAr::Push(int const&)' /home/rs/tmp/cc0KjPdZ.o(.text+0x50): In function `main': : undefined reference to `StackAr::Push(int const&)' /home/rs/tmp/cc0KjPdZ.o(.text+0x6a): In function `main': : undefined reference to `StackAr::Push(int const&)' /home/rs/tmp/cc0KjPdZ.o(.text+0x84): In function `main': : undefined reference to `StackAr::Pop()' /home/rs/tmp/cc0KjPdZ.o(.text+0xb6): In function `main': : undefined reference to `StackAr::Top() const' /home/rs/tmp/cc0KjPdZ.o(.text+0xe8): In function `main': : undefined reference to `StackAr::Pop()' /home/rs/tmp/cc0KjPdZ.o(.text+0x10f): In function `main': : undefined reference to `StackAr::~StackAr [in-charge]()' /home/rs/tmp/cc0KjPdZ.o(.text+0x12d): In function `main': : undefined reference to `StackAr::~StackAr [in-charge]()' collect2: ld returned 1 exit status I am using Mandrake Linux in x86. Thanks Ricardo From eljay@adobe.com Fri Aug 13 07:41:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 13 Aug 2004 07:41:00 -0000 Subject: Help with templates References: <411B97A8.4050607@isctem.com> Message-ID: <00d301c48094$e5511d30$67b2f882@PS253> Hi Ricardo, It looks like the main function does not have access to the template declaration. Is your template declaration in your StackAr.cpp? Then you'll need #include "StackAr.cpp" for your main, presuming main is located in mStackAr.cpp. Or vice-versa, if I have StackAr.cpp and mStackAr.cpp reversed. HTH, --Eljay From wilson@specifixinc.com Fri Aug 13 11:44:00 2004 From: wilson@specifixinc.com (James E Wilson) Date: Fri, 13 Aug 2004 11:44:00 -0000 Subject: problem in extended asm In-Reply-To: <20040809171020.61634.qmail@web52901.mail.yahoo.com> References: <20040809171020.61634.qmail@web52901.mail.yahoo.com> Message-ID: <411BF761.9030807@specifixinc.com> Ankit Jain wrote: > a simple question: why the followinf instruction > dosent work in gcc > asm("movq i(%1),%%mm0 \n" > "movq %%mm0,(%0) > :"=r"(x) > :"r"(m)); //m is an array Always include a testcase that can be compiled. A program fragment like this is a very poor bug report, as often the bug is in something you left out. In this particular case, the problem is likely that you are using arrays, and register allocation can not assign an array to a register, at least not after you have referenced an element of it. Hence, you can not use an 'r' constraint with an array. Try using a vector type or a union instead of an array. -- Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com From rs@isctem.com Fri Aug 13 11:46:00 2004 From: rs@isctem.com (Ricardo Santos) Date: Fri, 13 Aug 2004 11:46:00 -0000 Subject: Help with templates In-Reply-To: <00d301c48094$e5511d30$67b2f882@PS253> References: <411B97A8.4050607@isctem.com> <00d301c48094$e5511d30$67b2f882@PS253> Message-ID: <411C705F.5060501@isctem.com> Thanks Eljay. Yes, my main is located in mStackAr.cpp. I solved the problem creating an Instancialization file, that only have the folowing lines: #include "StackAr.cpp" template class StackAr; But why do I have to include a .cpp? Cpp's aren't linked??? I am a C guy, that's a little confusing. Ricardo Eljay Love-Jensen wrote: >Hi Ricardo, > >It looks like the main function does not have access to the template >declaration. > >Is your template declaration in your StackAr.cpp? Then you'll need #include >"StackAr.cpp" for your main, presuming main is located in mStackAr.cpp. > >Or vice-versa, if I have StackAr.cpp and mStackAr.cpp reversed. > >HTH, >--Eljay > > > > > From eljay@adobe.com Fri Aug 13 18:47:00 2004 From: eljay@adobe.com (John Love-Jensen) Date: Fri, 13 Aug 2004 18:47:00 -0000 Subject: Help with templates In-Reply-To: <411C705F.5060501@isctem.com> Message-ID: Hi Ricardo, > But why do I have to include a .cpp? Cpp's aren't linked??? I am a C guy, that's a little confusing. >From a C perspective, think of templates as being analogous to #define. What would happen if you did this in these files... ---- foo.h ---- /* Forward declaration */ #define foo ---- end-of-file ---- ---- foo.cpp ---- #define foo 120 ---- end-of-file ---- ---- main.cpp ---- #include "foo.h" int main() { return foo; } ---- end-of-file ---- You'd probably say, "That's not going to work!" And you're right. Same with templates! Templates are much like IN-LANGUAGE (instead of the PREPROCESSOR-BASED) definitions. The part that is "macro'd" in is the template type parameters. As such, the compiler needs to have the whole template (i.e., "macro") in hand to expand it as needed. Before you stress that the template, which can be quite hefty, is going to be replicated in every object file (and it is going to be replicated in every object file!), the linker is designed to strip out duplicates of the template so the final executable (or shared library or whatever) will only have one copy of the INSTANTIATED template. By "INSTANTIATED template", I mean that foo will be a different instantiation from foo, and that foo's code will not be reduced from foo. (Sidenote, there are some templating tricks that allows foo and foo to both reduce... but that's for the Stepanov's of the world to figure out.) However, 50 instances of foo will get reduced down to one instance of foo in the final executable. The above caveat about templates being fully in header files, is also true about inline functions. Inline functions should also be fully specified in the header file in C++. But inline functions don't "reduce", since they are inline, as you would expect with a macro-function #define. Sometimes a function tagged as inline cannot be inlined by the compiler, so in that case multiple copies of the the ersatz inline function will reduce in the final executable. NOTE: I'm glossing over a lot of details. I just want you to get the gist of the template animal in C++, from a C perspective. HTH, --Eljay From dk@artimi.com Fri Aug 13 18:57:00 2004 From: dk@artimi.com (Dave Korn) Date: Fri, 13 Aug 2004 18:57:00 -0000 Subject: problem in extended asm In-Reply-To: <411BF761.9030807@specifixinc.com> Message-ID: > -----Original Message----- > From: gcc-owner On Behalf Of James E Wilson > Sent: 13 August 2004 00:04 > To: Ankit Jain > Ankit Jain wrote: > > a simple question: why the followinf instruction > > dosent work in gcc > > asm("movq i(%1),%%mm0 \n" > > "movq %%mm0,(%0) > > :"=r"(x) > > :"r"(m)); //m is an array > > Always include a testcase that can be compiled. A program > fragment like > this is a very poor bug report, as often the bug is in something you > left out. > > In this particular case, the problem is likely that you are using > arrays, and register allocation can not assign an array to a > register, > at least not after you have referenced an element of it. > Hence, you can > not use an 'r' constraint with an array. > > Try using a vector type or a union instead of an array. ...The other problem being his attempt to smuggle the variable 'i' into the asm. But I'm curious now: doesn't the array reference degenerate to a pointer like it would if you passed it to a function that requires a pointer to whatever type the array is of? Or does it (or should it) follow the (machine and abi)-dependent rules for whether or not small structs are passed byval or reference in the calling convention? cheers, DaveK -- Can't think of a witty .sigline today.... From jmah@caduc.com Fri Aug 13 18:58:00 2004 From: jmah@caduc.com (Joseph Mah) Date: Fri, 13 Aug 2004 18:58:00 -0000 Subject: make gcc errors Message-ID: <013c01c48165$c14bd930$515aa8c0@WNYCCAD105283JM> Hello, I am running AIX 4.3.3. and am using the command: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap towards the end I get an error: make[1]: Entering directory `/gcc/gcc' gcc -g -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing- prot otypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -o genattrt ab \ genattrtab.o genautomata.o \ rtl.o read-rtl.o bitmap.o ggc-none.o min-insn-modes.o gensupport.o insn-conditi ons.o print-rtl1.o errors.o \ varray.o ../libiberty/libiberty.a -lm collect2: library libm not found make[1]: *** [genattrtab] Error 1 make[1]: Leaving directory `/gcc/gcc' make: *** [stage1_build] Error 2 make: *** [bootstrap] Error 2 What does this mean? Can anyone please help me? Thanks for any suggestions and helpful hints From gbras@anacomp.com Fri Aug 13 19:12:00 2004 From: gbras@anacomp.com (Bras, Gerard) Date: Fri, 13 Aug 2004 19:12:00 -0000 Subject: make gcc errors Message-ID: <66911C8E1F2DA24EB29DE289297A135E1FC037@usrd104.corp.anacomp.com> Joseph, What it means is that it's looking for libm.a and not finding it. Ordinarily if this happens it's because your LIBPATH env var is set wrong. I think the xlC ld knows where to look for it so.... which linker are you using? best regards, Gerard Bras -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Joseph Mah Sent: Friday, August 13, 2004 2:46 PM To: gcc-help@gcc.gnu.org Subject: make gcc errors Hello, I am running AIX 4.3.3. and am using the command: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap towards the end I get an error: make[1]: Entering directory `/gcc/gcc' gcc -g -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing- prot otypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -o genattrt ab \ genattrtab.o genautomata.o \ rtl.o read-rtl.o bitmap.o ggc-none.o min-insn-modes.o gensupport.o insn-conditi ons.o print-rtl1.o errors.o \ varray.o ../libiberty/libiberty.a -lm collect2: library libm not found make[1]: *** [genattrtab] Error 1 make[1]: Leaving directory `/gcc/gcc' make: *** [stage1_build] Error 2 make: *** [bootstrap] Error 2 What does this mean? Can anyone please help me? Thanks for any suggestions and helpful hints From wilson@specifixinc.com Fri Aug 13 19:46:00 2004 From: wilson@specifixinc.com (James E Wilson) Date: Fri, 13 Aug 2004 19:46:00 -0000 Subject: problem in extended asm In-Reply-To: References: Message-ID: <1092423493.25668.3.camel@aretha.corp.specifixinc.com> On Fri, 2004-08-13 at 04:44, Dave Korn wrote: > But I'm curious now: doesn't the array reference degenerate to a pointer > like it would if you passed it to a function that requires a pointer to > whatever type the array is of? Either way, it still fails. He was trying to use the value of the array, so if the address got loaded into the register then it would fail at run time. -- Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com From jmah@caduc.com Sat Aug 14 00:53:00 2004 From: jmah@caduc.com (Joseph Mah) Date: Sat, 14 Aug 2004 00:53:00 -0000 Subject: make gcc errors References: <66911C8E1F2DA24EB29DE289297A135E1FC037@usrd104.corp.anacomp.com> Message-ID: <015901c48169$36198d90$515aa8c0@WNYCCAD105283JM> I am not sure what linker I am using, is there a way to find out for sure? running set shows no LIBPATH and _=linker. ------------------------ Joseph, What it means is that it's looking for libm.a and not finding it. Ordinarily if this happens it's because your LIBPATH env var is set wrong. I think the xlC ld knows where to look for it so.... which linker are you using? best regards, Gerard Bras -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Joseph Mah Sent: Friday, August 13, 2004 2:46 PM To: gcc-help@gcc.gnu.org Subject: make gcc errors Hello, I am running AIX 4.3.3. and am using the command: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap towards the end I get an error: make[1]: Entering directory `/gcc/gcc' gcc -g -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing- prot otypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -o genattrt ab \ genattrtab.o genautomata.o \ rtl.o read-rtl.o bitmap.o ggc-none.o min-insn-modes.o gensupport.o insn-conditi ons.o print-rtl1.o errors.o \ varray.o ../libiberty/libiberty.a -lm collect2: library libm not found make[1]: *** [genattrtab] Error 1 make[1]: Leaving directory `/gcc/gcc' make: *** [stage1_build] Error 2 make: *** [bootstrap] Error 2 What does this mean? Can anyone please help me? Thanks for any suggestions and helpful hints From trick@icculus.org Sat Aug 14 02:04:00 2004 From: trick@icculus.org (Gerry) Date: Sat, 14 Aug 2004 02:04:00 -0000 Subject: Creating executable shared libraries ? Message-ID: <200408132145.56429.trick@icculus.org> Hello. I'm trying to create a shared library that can also be executed as a normal executable in Linux (like libc.so), but I've run into some problems. For it to be linkable as a shared library I have to use the -shared option, but that disables any entry point information. Either leaving main in (as a weak symbol) or using the -e option (which seems to be undocumented ?) results in segfaults and such because no libraries seem to be resolved, not even libc. I've tried linking the required libraries statically, but that doesn't seem to work either. Googling didn't turn up anything useful. Does anyone know how to do this properly ? (Please cc any answers to me, as I'm not subscribed to this list.) Thanks, - Gerry From yoobb@earthlink.net Sat Aug 14 02:45:00 2004 From: yoobb@earthlink.net (Bernard Yoo) Date: Sat, 14 Aug 2004 02:45:00 -0000 Subject: assigning character strings to double precision values in DATA statements Message-ID: <5A44D8EC-ED8C-11D8-A8F1-000A95DAD22E@earthlink.net> Hi, I have an old Fortran 77 program that uses DATA statements to assign character strings to variables that have been declared double precision. Many commercial compilers seem to accept this "undocumented" method of assignment, but g77 does not. Is there any way around this? B.Y. From webman.li@utstar.com Sat Aug 14 03:11:00 2004 From: webman.li@utstar.com (webman.li) Date: Sat, 14 Aug 2004 03:11:00 -0000 Subject: a question about shared library Message-ID: <003d01c481a3$66bf6c50$351313ac@cn.utstarcom.com> hi, I have compiled a shared library using G++ on solaris. I use Sun's linker to link this library with other objs and libs that are compiled using SUN's CC compiler.It is failed. Is libs compiled using G++ can not be linked,using SUN's linker, with libs & objs compiled using SUN's CC?? thanks From jeff.holle@verizon.net Sat Aug 14 07:37:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Sat, 14 Aug 2004 07:37:00 -0000 Subject: problem using a custom exception class Message-ID: I'm using gcc v3.4.1. I've a custom exception class which I'm using in a library that compiles without any compiler errors/warnings. When I attempt to use this library, I get: : undefined reference to `typeinfo for attribute_error' My custom exception class, modeled using info from stdexcept, is: class attribute_error : public std::exception { public: explicit attribute_error(const std::string& attributeName) throw(); // used for missing attribute explicit attribute_error(const std::string& attributeName, const std::string& msg) throw(); virtual ~attribute_error() throw() {} virtual const char* what() const throw(); private: std::string msg_; }; Can someone point me to how to fix this? From bdavis@gcc.gnu.org Sat Aug 14 09:30:00 2004 From: bdavis@gcc.gnu.org (Bud Davis) Date: Sat, 14 Aug 2004 09:30:00 -0000 Subject: assigning character strings to double precision values in DATA statements Message-ID: <1092453070.4668.2.camel@localhost.localdomain> Here is an example using hollerith constants: $ cat b.f double precision a(2) data a /8Hred ,8Hblue / print '(2A)',a end $ g77 b.f $ ./a.out red blue Is this what you need ? post a small example of the code in question, it will help us understand exactly what the issue is. Hope this helps, bud davis From uphdufzm@hutchcity.com Sat Aug 14 15:44:00 2004 From: uphdufzm@hutchcity.com (Joy Nicholson) Date: Sat, 14 Aug 2004 15:44:00 -0000 Subject: code# PG-635-T Message-ID: Hi, I sent you an email last week and I'd like to confirm everything now. Please read the info below and let me know if you have any questions. We are accepting your mo:rtgage application. If you have b-ad (c:re dit), it's ok. You can get a $200,000 loan for a $350 per month payment. Approval process will only take 1 minute. Just visit the link below and fill out the short form. Thank You http://wlgteamlender.com/?partid=fbuff123 Best Regards, Manager: Joy Nicholson USA Broker Group Tijuana has a beautiful new home in Colorado- and you can too ! Future options: wlgteamlender.com/st.html From bjg@network-theory.co.uk Sat Aug 14 17:25:00 2004 From: bjg@network-theory.co.uk (Brian Gough) Date: Sat, 14 Aug 2004 17:25:00 -0000 Subject: Help with templates In-Reply-To: Ricardo Santos's message of "Thu, 12 Aug 2004 18:15:36 +0200" References: <411B97A8.4050607@isctem.com> Message-ID: <87pt5u6prj.fsf@network-theory.co.uk> Ricardo Santos writes: > I have a problem with templates. I am doing a little class (Stack) > to demonstrate templates, and I have a library problem. See also p57-61 of the GCC tutorial I published recently (url below). The book is available under the GNU Free Documentation License, with a PDF on the site. -- Brian Gough Network Theory Ltd, Publishing "An Introduction to GCC" -- http://network-theory.co.uk/gcc/intro/ From jeff.holle@verizon.net Sat Aug 14 18:01:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Sat, 14 Aug 2004 18:01:00 -0000 Subject: problem using a custom exception class In-Reply-To: References: Message-ID: An update. I was able to avoid this problem by replacing attribute_error with runtime_error. I don't want to keep my code this way, attribute_error hides use of ostringstring to format a meanful error... So I still would like to know what is wrong with my attribute_error class. Before somebody asks: 1. I did include the implementation of attribute_error in the library. 2. I tried to link all the files of my library instead of using a library. I got the very same results... Jeffrey Holle wrote: > I'm using gcc v3.4.1. > > I've a custom exception class which I'm using in a library that compiles > without any compiler errors/warnings. > > When I attempt to use this library, I get: > : undefined reference to `typeinfo for attribute_error' > > > My custom exception class, modeled using info from stdexcept, is: > > class attribute_error : public std::exception > { > public: > explicit attribute_error(const std::string& attributeName) throw(); // > used for missing attribute > explicit attribute_error(const std::string& attributeName, const > std::string& msg) throw(); > virtual ~attribute_error() throw() {} > virtual const char* what() const throw(); > private: > std::string msg_; > }; > > > Can someone point me to how to fix this? > > From eldering@phys.uu.nl Sat Aug 14 18:11:00 2004 From: eldering@phys.uu.nl (Jaap Eldering) Date: Sat, 14 Aug 2004 18:11:00 -0000 Subject: static link errors with libm Message-ID: <20040814172523.GB19493@a-eskwadraat.nl> Hello, I'm having problems linking statically with the math library. When compiling the following program: #include int main() { sin(0); return 0; } with 'gcc -static -lm -o progname progname.c', I get errors: /tmp/ccZSyXXG.o: In function `main': /tmp/ccZSyXXG.o(.text+0xe): undefined reference to `sin' collect2: ld returned 1 exit status while without the -static option, all is fine. More strangly, if I compile with 'g++ -x c -static -lm -o progname progname.c' then it compiles fine too. I have this problem on Debian stable with gcc 2.95.4 and 3.0.4 and on SunOS with gcc 3.2.2, but not on Compaq Tru64 UNIX V5.1A with gcc 3.4.1 Thanks for any help, Jaap Eldering From ishwar@pali.cps.cmich.edu Sat Aug 14 22:26:00 2004 From: ishwar@pali.cps.cmich.edu (Ishwar Rattan) Date: Sat, 14 Aug 2004 22:26:00 -0000 Subject: static link errors with libm In-Reply-To: <20040814172523.GB19493@a-eskwadraat.nl> References: <20040814172523.GB19493@a-eskwadraat.nl> Message-ID: Try -lm as the last command-line argument to gcc -ishwar On Sat, 14 Aug 2004, Jaap Eldering wrote: > Hello, > > I'm having problems linking statically with the math library. > > When compiling the following program: > > #include > > int main() > { > sin(0); > return 0; > } > > with 'gcc -static -lm -o progname progname.c', I get errors: > > /tmp/ccZSyXXG.o: In function `main': > /tmp/ccZSyXXG.o(.text+0xe): undefined reference to `sin' > collect2: ld returned 1 exit status > > while without the -static option, all is fine. More strangly, if I > compile with 'g++ -x c -static -lm -o progname progname.c' then it > compiles fine too. > > I have this problem on Debian stable with gcc 2.95.4 and 3.0.4 and on > SunOS with gcc 3.2.2, but not on Compaq Tru64 UNIX V5.1A with gcc 3.4.1 > > Thanks for any help, > Jaap Eldering > From eldering@phys.uu.nl Sat Aug 14 23:50:00 2004 From: eldering@phys.uu.nl (Jaap Eldering) Date: Sat, 14 Aug 2004 23:50:00 -0000 Subject: static link errors with libm In-Reply-To: References: <20040814172523.GB19493@a-eskwadraat.nl> Message-ID: <20040814181116.GC19493@a-eskwadraat.nl> On Sat, Aug 14, 2004 at 02:04:48PM -0400, Ishwar Rattan wrote: > Try -lm as the last command-line argument to gcc > -ishwar Ok, this works. Thanks! But why does it have to be last? I'd suppose only the order with respect to -static might matter. Jaap > On Sat, 14 Aug 2004, Jaap Eldering wrote: > > > Hello, > > > > I'm having problems linking statically with the math library. > > > > When compiling the following program: > > > > #include > > > > int main() > > { > > sin(0); > > return 0; > > } > > > > with 'gcc -static -lm -o progname progname.c', I get errors: > > > > /tmp/ccZSyXXG.o: In function `main': > > /tmp/ccZSyXXG.o(.text+0xe): undefined reference to `sin' > > collect2: ld returned 1 exit status > > > > while without the -static option, all is fine. More strangly, if I > > compile with 'g++ -x c -static -lm -o progname progname.c' then it > > compiles fine too. > > > > I have this problem on Debian stable with gcc 2.95.4 and 3.0.4 and on > > SunOS with gcc 3.2.2, but not on Compaq Tru64 UNIX V5.1A with gcc 3.4.1 > > > > Thanks for any help, > > Jaap Eldering > > From larry.brown@dimensionnetworks.com Sun Aug 15 02:08:00 2004 From: larry.brown@dimensionnetworks.com (Larry Brown) Date: Sun, 15 Aug 2004 02:08:00 -0000 Subject: Newbie Hello Message-ID: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> I hope I'm in the right place... I am a fairly accomplished php developer and have written quite a bit of code with it. However, all of my coding experience has been with scripting languages and I have never had to deal with memory allocation and rarely ever dealt with pointers or casting etc. For instance... with scripting I can simply access arguments by referencing the string at argv[1] or ARGV[1] etc. It looks like I should be able to do this with c but I have to reference *argv[x] and *argv[x] only holds the first character. The following is a snippet... int main(int argc, *argv[]) { int secondVar=*argv[2]; } if the second argument is say ... 10, I only get the 1. There is some logic that I must follow that I can't see. I've tried looking at *argv[2][0] to see if it was one and *argv[2][1] was zero but is aparently not the case. I have looked at several howto/instruction documents and none seem to yeild much. TIA Again, I hope I'm in the right place... Larry From ishwar@pali.cps.cmich.edu Sun Aug 15 09:30:00 2004 From: ishwar@pali.cps.cmich.edu (Ishwar Rattan) Date: Sun, 15 Aug 2004 09:30:00 -0000 Subject: Newbie Hello In-Reply-To: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> References: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> Message-ID: Locate a basic C programming txt and read it carefully or stick with scripting.. -ishwar On Sat, 14 Aug 2004, Larry Brown wrote: > I hope I'm in the right place... I am a fairly accomplished php > developer and have written quite a bit of code with it. However, all of > my coding experience has been with scripting languages and I have never > had to deal with memory allocation and rarely ever dealt with pointers > or casting etc. > > For instance... > > with scripting I can simply access arguments by referencing the string > at argv[1] or ARGV[1] etc. It looks like I should be able to do this > with c but I have to reference *argv[x] and *argv[x] only holds the > first character. The following is a snippet... > > int main(int argc, *argv[]) > { > int secondVar=*argv[2]; > } > > if the second argument is say ... 10, I only get the 1. There is some > logic that I must follow that I can't see. I've tried looking at > *argv[2][0] to see if it was one and *argv[2][1] was zero but is > aparently not the case. > > I have looked at several howto/instruction documents and none seem to > yeild much. > > TIA > > Again, I hope I'm in the right place... > > Larry > From jeff.holle@verizon.net Sun Aug 15 16:57:00 2004 From: jeff.holle@verizon.net (Jeffrey Holle) Date: Sun, 15 Aug 2004 16:57:00 -0000 Subject: Newbie Hello In-Reply-To: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> References: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> Message-ID: The thing that you need to know about the difference between a scripting language and C/C++ is that the later is strongly typed. This means that you basically need to know what these types are and what can and can't be auto converted. In your case, you are treating a *char as an int. If you are using C++, the most eligant way to do this is via boost::lexical_cast. In C, there are more primative facilities. Look for atoi documentation. Larry Brown wrote: > I hope I'm in the right place... I am a fairly accomplished php > developer and have written quite a bit of code with it. However, all of > my coding experience has been with scripting languages and I have never > had to deal with memory allocation and rarely ever dealt with pointers > or casting etc. > > For instance... > > with scripting I can simply access arguments by referencing the string > at argv[1] or ARGV[1] etc. It looks like I should be able to do this > with c but I have to reference *argv[x] and *argv[x] only holds the > first character. The following is a snippet... > > int main(int argc, *argv[]) > { > int secondVar=*argv[2]; > } > > if the second argument is say ... 10, I only get the 1. There is some > logic that I must follow that I can't see. I've tried looking at > *argv[2][0] to see if it was one and *argv[2][1] was zero but is > aparently not the case. > > I have looked at several howto/instruction documents and none seem to > yeild much. > > TIA > > Again, I hope I'm in the right place... > > Larry > > From bjg@network-theory.co.uk Sun Aug 15 17:56:00 2004 From: bjg@network-theory.co.uk (Brian Gough) Date: Sun, 15 Aug 2004 17:56:00 -0000 Subject: static link errors with libm In-Reply-To: Jaap Eldering's message of "Sat, 14 Aug 2004 20:11:16 +0200" References: <20040814172523.GB19493@a-eskwadraat.nl> <20040814181116.GC19493@a-eskwadraat.nl> Message-ID: <87vffkeol9.fsf@network-theory.co.uk> Jaap Eldering writes: > On Sat, Aug 14, 2004 at 02:04:48PM -0400, Ishwar Rattan wrote: > > Try -lm as the last command-line argument to gcc > > -ishwar > > Ok, this works. Thanks! > > But why does it have to be last? I'd suppose only the order with respect > to -static might matter. Object files and libraries are searched from left-to-right so the sin() function is not picked up when -lm appears first. In C, the math library is separate from the main standard library for historical reasons. In C++ you don't need a separate -lm so the g++ command works on its own. -- Brian Gough Network Theory Ltd, Publishing "An Introduction to GCC" --- http://network-theory.co.uk/gcc/intro/ From stuart.191@ntlworld.com Mon Aug 16 06:20:00 2004 From: stuart.191@ntlworld.com (stuart macgregor) Date: Mon, 16 Aug 2004 06:20:00 -0000 Subject: djgpp and cygwin gcc do not have complex.h, but gcc on linux does? Message-ID: <200408151757.17143.stuart.191@ntlworld.com> I would like to compile the nec2c program with a dos/windows target (a command line file in -> file out program). It includes complex.h, which allows it to do complex maths on a unix gcc (a c99 extension?), but it and associated files seem to be missing on the djgpp and cygwin distributions. Is there something I can download to fix this? From nutrina9@yahoo.de Mon Aug 16 08:28:00 2004 From: nutrina9@yahoo.de (=?iso-8859-1?q?Gerald=20Iakobinyi=20Pich?=) Date: Mon, 16 Aug 2004 08:28:00 -0000 Subject: help installing gcc 2.95.3 Message-ID: <20040815175558.29226.qmail@web50104.mail.yahoo.com> Hello I would like to install gcc 1.95.3 on my FreeBSD system (now I have gcc 3.3.3 but I need gcc 1.95.3 for testing some progs). This is what I did: # mkdir gcc_obj # cd gcc_obj # ../gcc-2.95.3/configure until here everything seems to have gone just fine. Then I run: # make bootstrap And this is what I get: nutrina# make bootstrap if [ x"no" = xyes ] && [ ! -d pic ]; then mkdir pic; else true; fi touch stamp-picdir test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/argv.c -o pic/argv.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/argv.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/choose-temp.c -o pic/choose-temp.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/choose-temp.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/concat.c -o pic/concat.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/concat.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/cplus-dem.c -o pic/cplus-dem.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/cplus-dem.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/fdmatch.c -o pic/fdmatch.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/fdmatch.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/fnmatch.c -o pic/fnmatch.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/fnmatch.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getopt.c -o pic/getopt.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getopt.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getopt1.c -o pic/getopt1.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getopt1.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getruntime.c -o pic/getruntime.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/getruntime.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/hex.c -o pic/hex.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/hex.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/floatformat.c -o pic/floatformat.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/floatformat.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/objalloc.c -o pic/objalloc.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/objalloc.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/obstack.c -o pic/obstack.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/obstack.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/pexecute.c -o pic/pexecute.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/pexecute.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/spaces.c -o pic/spaces.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/spaces.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/splay-tree.c -o pic/splay-tree.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/splay-tree.c test x"no" != xyes || gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/strerror.c -o pic/strerror.o gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../gcc-2.95.3/libiberty/../include ../../gcc-2.95.3/libiberty/strerror.c ../../gcc-2.95.3/libiberty/strerror.c:465: error: conflicting types for `sys_nerr' /usr/include/stdio.h:347: error: previous declaration of `sys_nerr' *** Error code 1 Stop in /root/private/gcc/gcc_obj/libiberty. *** Error code 1 Stop in /root/private/gcc/gcc_obj. Could somebody please help me out ??? Best Regards, Gerald ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de From webman.li@utstar.com Mon Aug 16 11:02:00 2004 From: webman.li@utstar.com (webman.li) Date: Mon, 16 Aug 2004 11:02:00 -0000 Subject: a question about shared library Message-ID: <000e01c48359$6b67cfb0$351313ac@cn.utstarcom.com> hi, I have compiled a shared library using g++ on solaris. I use Sun's linker to link this library with other objs and libs that are compiled by SUN's CC compiler.It is failed. Are libs compiled using g++ can not be linked,using SUN's linker, with libs & objs compiled by SUN's CC?? thanks From arno.wilhelm@profile.co.at Mon Aug 16 11:26:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Mon, 16 Aug 2004 11:26:00 -0000 Subject: Newbie Hello In-Reply-To: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> References: <1092522609.4185.18.camel@administrator.dimensionnetworks.com> Message-ID: <1092644910.2694.4.camel@dione.profile.co.at> On Sun, 2004-08-15 at 00:30, Larry Brown wrote: > I hope I'm in the right place... I am a fairly accomplished php > developer and have written quite a bit of code with it. However, all of > my coding experience has been with scripting languages and I have never > had to deal with memory allocation and rarely ever dealt with pointers > or casting etc. > > For instance... > > with scripting I can simply access arguments by referencing the string > at argv[1] or ARGV[1] etc. It looks like I should be able to do this > with c but I have to reference *argv[x] and *argv[x] only holds the > first character. The following is a snippet... > > int main(int argc, *argv[]) > { > int secondVar=*argv[2]; > } > > if the second argument is say ... 10, I only get the 1. There is some > logic that I must follow that I can't see. I've tried looking at > *argv[2][0] to see if it was one and *argv[2][1] was zero but is > aparently not the case. > > I have looked at several howto/instruction documents and none seem to > yeild much. > > TIA > > Again, I hope I'm in the right place... > > Larry Try this: main.c: ------- 1 #include 2 #include 3 4 int main( int argc, char * argv[] ) 5 { 6 7 char * stringVar = argv[1]; 8 printf( "stringVar = %s\n", stringVar ); 9 int numberVar = atoi( stringVar ); 10 printf( "numberVar = %d\n", numberVar ); 11 12 13 return 0; 14 } > gcc -g -Wall -o args main.c > ./args 10 stringVar = 10 numberVar = 10 > -- Arno Wilhelm proFILE Computersysteme GmbH From SMcGarry@acadinfo.co.uk Mon Aug 16 15:28:00 2004 From: SMcGarry@acadinfo.co.uk (McGarry, Simon) Date: Mon, 16 Aug 2004 15:28:00 -0000 Subject: Error Compiling gcc 4.3.1 on AIX 4.3.3 Message-ID: <2D7E4B95F631D711A7A5000802F0140901657D5D@holly.academy.co.uk> Hi all, I've run a Configure and then make bootstrap with LDFLAGS set to "-Wl,-bbigtoc" in the Makefile. These ran successfully but when I did a make install I got the following errors: /bin/sh ../libtool --tag CXX --mode=link /usr/gnu/smc/src/build-gcc/gcc/xgcc -shared-libgcc -B/usr/gnu/smc/src/build-gcc/gcc/ -nostdinc++ -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src /.libs -B/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/bin/ -B/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/lib/ -isystem /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/include -isystem /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/sys-include -pthread -Wl,-O1 -Wl,-G -fno-implicit-templates -Wall -W -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -pthread -o libstdc++.la -rpath /usr/gnu/smc/lib/pthread -version-info 6:1:0 -Wl,--version-script=libstdc++-symbol.ver -lm allocator.lo codecvt.lo complex_io.lo ctype.lo debug.lo debug_list.lo functexcept.lo globals_locale.lo globals_io.lo ios.lo ios_failure.lo ios_init.lo ios_locale.lo limits.lo list.lo locale.lo locale_init.lo locale_facets.lo localename.lo stdexcept.lo strstream.lo tree.lo allocator-inst.lo concept-inst.lo fstream-inst.lo ext-inst.lo io-inst.lo istream-inst.lo locale-inst.lo locale-misc-inst.lo misc-inst.lo ostream-inst.lo sstream-inst.lo streambuf-inst.lo string-inst.lo valarray-inst.lo wlocale-inst.lo wstring-inst.lo atomicity.lo codecvt_members.lo collate_members.lo ctype_members.lo messages_members.lo monetary_members.lo numeric_members.lo time_members.lo basic_file.lo c++locale.lo ../libmath/libmath.la ../libsupc++/libsupc++convenience.la -lm generating symbol list for `libstdc++.la' /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/bin/nm -B -X32_64 -Bpg .libs/allocator.o .libs/codecvt.o .libs/complex_io.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/globals_locale.o .libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/locale-inst.o .libs/locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-inst.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .libs/c++locale.o ../libmath/.libs/libmath.a ../libsupc++/.libs/libsupc++convenience.a | awk '{ if ((($2 == "T") || ($2 == "D") || ($2 == "B")) && (substr($3,1,1) != ".")) { print $3 } }' | sort -u > .libs/libstdc++.exp /usr/gnu/smc/src/build-gcc/gcc/xgcc -shared-libgcc -B/usr/gnu/smc/src/build-gcc/gcc/ -nostdinc++ -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src /.libs -B/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/bin/ -B/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/lib/ -isystem /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/include -isystem /usr/gnu/smc/powerpc-ibm-aix4.3.3.0/sys-include -pthread -shared -o .libs/libstdc++.so.6 .libs/allocator.o .libs/codecvt.o .libs/complex_io.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/globals_locale.o .libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/locale-inst.o .libs/locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-inst.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .libs/c++locale.o -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src -L/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/src /.libs -lm ../libmath/.libs/libmath.a -lm ../libsupc++/.libs/libsupc++convenience.a -lm -L/usr/gnu/smc/src/build-gcc/gcc/pthread -L/usr/gnu/smc/src/build-gcc/gcc -L/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/bin -L/usr/gnu/smc/powerpc-ibm-aix4.3.3.0/lib -L/usr/gnu/smc/lib/../powerpc-ibm-aix4.3.3.0/lib -L/usr/gnu/smc/lib -lgcc_s_pthread -L/usr/lib/threads -lpthreads -lc_r -lgcc_s_pthread -lm -lgcc_s_pthread -lpthreads -lc_r -lgcc_s_pthread -lc -Wl,-O1 -Wl,-G -Wl,--version-script=libstdc++-symbol.ver -Wl,-bE:.libs/libstdc++.exp -Wl,-bnoentry ${wl}-berok .libs/codecvt.o(.tc+0x0):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecvt .cc: undefined reference to `vtable for std::__codecvt_abstract_base' .libs/codecvt.o(.tc+0x0):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecvt .cc: undefined reference to `vtable for std::__codecvt_abstract_base' .libs/codecvt.o(.rw+0x2c):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecv t.cc: undefined reference to `vtable for __cxxabiv1::__si_class_type_info' .libs/codecvt.o(.rw+0x34):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecv t.cc: undefined reference to `typeinfo for std::__codecvt_abstract_base' .libs/codecvt.o(.rw+0x64):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecv t.cc: undefined reference to `vtable for __cxxabiv1::__si_class_type_info' .libs/codecvt.o(.rw+0x6c):/usr/gnu/smc/src/gcc-3.4.1/libstdc++-v3/src/codecv t.cc: undefined reference to `typeinfo for std::__codecvt_abstract_base' .libs/complex_io.o(.pr+0x20): In function `.std::basic_istream >& std::operator>> >(std::basic_istream >&, std::complex&)': ------ SNIP There were a huge amout of "undefined reference to" errors, it eventually failed with: collect2: ld returned 1 exit status make[4]: *** [abi_check] Error 1 make[4]: Leaving directory `/_/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3/te stsuite' make[3]: *** [install-recursive] Error 1 make[3]: Leaving directory `/_/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/pthread/libstdc++-v3' make[2]: *** [multi-do] Error 1 make[2]: Leaving directory `/_/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/libstdc++-v3' make[1]: *** [install-multi] Error 2 make[1]: Leaving directory `/_/usr/gnu/smc/src/build-gcc/powerpc-ibm-aix4.3.3.0/libstdc++-v3' make: *** [install-target-libstdc++-v3] Error 2 Can anyone offer some help? Thanks Simon McGarry Technical Consultant Capita Software Services 0870 1631834 simon.mcgarry@capita.co.uk --------------------------------------------------------------------- This Email is confidential and may also be privileged. If you are not the intended recipient, please notify the sender IMMEDIATELY; you should not copy the email or use it for any purpose or disclose its contents to any other person. Any statements made, or intentions expressed in this communication may not necessarily reflect the view of the Capita Group and that the content herein may not be held binding upon the Capita Group or any associated company. ---------------------------------------------------------------------- From eljay@adobe.com Mon Aug 16 15:41:00 2004 From: eljay@adobe.com (John Love-Jensen) Date: Mon, 16 Aug 2004 15:41:00 -0000 Subject: a question about shared library In-Reply-To: <000e01c48359$6b67cfb0$351313ac@cn.utstarcom.com> Message-ID: Hi, >Are libs compiled using g++ can not be linked,using SUN's linker, with libs & objs compiled by SUN's CC?? Correct. Use GNU's binutil's linker "ld". HTH, --Eljay From petsku86@welho.com Mon Aug 16 16:30:00 2004 From: petsku86@welho.com (petsku86@welho.com) Date: Mon, 16 Aug 2004 16:30:00 -0000 Subject: Optimized code with GCC-3.3.3 Message-ID: <1092670127.4120d2af702b0@webmail.welho.com> Hi! I am trying to optimize to code produced by gcc-3.3.3 for my pentium4. After reading the following manual page a got a little confused. http://tinyurl.com/5zt9b Does -march=cpu-type mean that a I automaticly have also -mcpu or do I have to specify them both to get the best possible code? Imply is a verb which when translated to my language (Finnish) could mean that it comes automaticly or it needs to be specified. I tried using google but I didn't get any answers there because I saw the -march option used both with and without -mcpu. Thanks in advance. Regards, Petteri R??ty From segher@kernel.crashing.org Mon Aug 16 16:44:00 2004 From: segher@kernel.crashing.org (Segher Boessenkool) Date: Mon, 16 Aug 2004 16:44:00 -0000 Subject: Creating executable shared libraries ? In-Reply-To: <200408132145.56429.trick@icculus.org> References: <200408132145.56429.trick@icculus.org> Message-ID: > Hello. I'm trying to create a shared library that can also be executed > as a > normal executable in Linux (like libc.so), but I've run into some > problems. See http://gcc.gnu.org/ml/gcc-help/2003-07/msg00232.html . Segher From lrtaylor@micron.com Mon Aug 16 17:04:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Mon, 16 Aug 2004 17:04:00 -0000 Subject: a question about shared library Message-ID: <363801FFD7B74240A329CEC3F7FE4CC4030960B5@ntxboimbx07.micron.com> Actually, the problem is probably due to the fact that he is using two different compilers (g++ and CC) than because he's using Sun's linker. C++ code compiled with g++ is not compatible with C++ code compiled with Sun's compilers. The linker you use can make a difference, but I don't think that's your problem in this case. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of John Love-Jensen Sent: Monday, August 16, 2004 5:16 AM To: webman.li; gcc-help@gcc.gnu.org Subject: Re: a question about shared library Hi, >Are libs compiled using g++ can not be linked,using SUN's linker, with libs & objs compiled by SUN's CC?? Correct. Use GNU's binutil's linker "ld". HTH, --Eljay From lrtaylor@micron.com Mon Aug 16 17:14:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Mon, 16 Aug 2004 17:14:00 -0000 Subject: Newbie Hello Message-ID: <363801FFD7B74240A329CEC3F7FE4CC40215DBB7@ntxboimbx07.micron.com> Larry, Ishwar, while rude(!), has a good point that you should get a good beginners book on C or C++ programming. For C, I might recommend "The C Programming Language" by Kernighan and Ritchie. While not a beginners book, it's a good, concise reference to the language suitable for experienced developers. The reason for this recommendation is that C and C++ handle things like strings much differently than scripting languages do, and you need to understand how this works in order to be able to effectively use them. In this case, what's really happening is that your command line arguments are being passed into your main function in an array of strings (C-style strings - that is, character arrays), where each array element of argv is a pointer that points to the first character of that null-terminated string. So, argv[0] points to the first character of the first argument. Adding the dereference operator dereferences that pointer and returns that first character. To use the whole string, you would pass the pointer to that string to functions that can manipulate strings. For example, if you are expecting a number, you can use the atoi function (ASCII to integer) like this: int num = atoi(argv[1]); Doing something like *argv[1] will return the first character of that argument. If the user entered '10', then it would return the ASCII character for '1', not the value 1. Hope this helps a bit. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Larry Brown Sent: Saturday, August 14, 2004 4:30 PM To: gcc-help@gcc.gnu.org Subject: Newbie Hello I hope I'm in the right place... I am a fairly accomplished php developer and have written quite a bit of code with it. However, all of my coding experience has been with scripting languages and I have never had to deal with memory allocation and rarely ever dealt with pointers or casting etc. For instance... with scripting I can simply access arguments by referencing the string at argv[1] or ARGV[1] etc. It looks like I should be able to do this with c but I have to reference *argv[x] and *argv[x] only holds the first character. The following is a snippet... int main(int argc, *argv[]) { int secondVar=*argv[2]; } if the second argument is say ... 10, I only get the 1. There is some logic that I must follow that I can't see. I've tried looking at *argv[2][0] to see if it was one and *argv[2][1] was zero but is aparently not the case. I have looked at several howto/instruction documents and none seem to yeild much. TIA Again, I hope I'm in the right place... Larry From Rongjun.Lu@cern.ch Mon Aug 16 18:49:00 2004 From: Rongjun.Lu@cern.ch (Rongjun Lu) Date: Mon, 16 Aug 2004 18:49:00 -0000 Subject: problem when building gcc 4.3.0 Message-ID: <3FC7FEE5A901664193468E8F63AFE1EA4D30ED@cernxchg15.cern.ch> Dear Sir: when I build the gcc 4.3.0 for bootloader cross-compiler, the building process failed with pthread errors.Is there any one can tell me why? Thanks. I configured the gcc as following: ../build-gcc/configure --target=arm-linux \ >--prefix=/home/lurj/board_tms5471/tools --without-headers --with-newlib \ >--enable-languages=c then make all-gcc the error are following: ......... arm-linux-ranlib ./libgcov.a /home/lurj/board_tms5471/build-tools/build-gcc/gcc/xgcc -B/home/lurj/board_tms5471/build-tools/build-gcc/gcc/ -B//home/lurj/board_tms5471/tools/arm-linux/bin/ -B//home/lurj/board_tms5471/tools/arm-linux/lib/ -isystem //home/lurj/board_tms5471/tools/arm-linux/include -isystem //home/lurj/board_tms5471/tools/arm-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fomit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-3.4.0/gcc -I../../gcc-3.4.0/gcc/. -I../../gcc-3.4.0/gcc/../include -fexceptions -c ../../gcc-3.4.0/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o In file included from ./gthr-default.h:1, from ../../gcc-3.4.0/gcc/gthr.h:96, from ../../gcc-3.4.0/gcc/unwind-dw2.c:42: ../../gcc-3.4.0/gcc/gthr-posix.h:43:21: pthread.h: No such file or directory ../../gcc-3.4.0/gcc/gthr-posix.h:44:20: unistd.h: No such file or directory In file included from ./gthr-default.h:1, from ../../gcc-3.4.0/gcc/gthr.h:96, from ../../gcc-3.4.0/gcc/unwind-dw2.c:42: ../../gcc-3.4.0/gcc/gthr-posix.h:46: error: parse error before "__gthread_key_t" ../../gcc-3.4.0/gcc/gthr-posix.h:46: warning: type defaults to `int' in declaration of `__gthread_key_t' ../../gcc-3.4.0/gcc/gthr-posix.h:46: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h:47: error: parse error before "__gthread_once_t" ../../gcc-3.4.0/gcc/gthr-posix.h:47: warning: type defaults to `int' in declaration of `__gthread_once_t' ../../gcc-3.4.0/gcc/gthr-posix.h:47: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h:48: error: parse error before "__gthread_mutex_t" ../../gcc-3.4.0/gcc/gthr-posix.h:48: warning: type defaults to `int' in declaration of `__gthread_mutex_t' ../../gcc-3.4.0/gcc/gthr-posix.h:48: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_active_p': ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: `pthread_create' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: (Each undeclared identifier is reported only once ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: for each function it appears in.) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:456: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:456: error: parse error before ')' token ../../gcc-3.4.0/gcc/gthr-posix.h:465: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:465: error: parse error before ')' token ../../gcc-3.4.0/gcc/gthr-posix.h:471: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:472: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_key_delete': ../../gcc-3.4.0/gcc/gthr-posix.h:472: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:473: warning: implicit declaration of function `pthread_key_delete' ../../gcc-3.4.0/gcc/gthr-posix.h:473: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:477: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:478: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_getspecific': ../../gcc-3.4.0/gcc/gthr-posix.h:478: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:479: warning: implicit declaration of function `pthread_getspecific' ../../gcc-3.4.0/gcc/gthr-posix.h:479: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:479: warning: return makes pointer from integer without a cast ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:483: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:484: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_setspecific': ../../gcc-3.4.0/gcc/gthr-posix.h:484: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:485: warning: implicit declaration of function `pthread_setspecific' ../../gcc-3.4.0/gcc/gthr-posix.h:485: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:485: error: `ptr' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:489: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:490: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_lock': ../../gcc-3.4.0/gcc/gthr-posix.h:490: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:492: warning: implicit declaration of function `pthread_mutex_lock' ../../gcc-3.4.0/gcc/gthr-posix.h:492: error: `mutex' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:498: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:499: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_trylock': ../../gcc-3.4.0/gcc/gthr-posix.h:499: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:501: warning: implicit declaration of function `pthread_mutex_trylock' ../../gcc-3.4.0/gcc/gthr-posix.h:501: error: `mutex' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:507: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:508: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_unlock': ../../gcc-3.4.0/gcc/gthr-posix.h:508: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:510: warning: implicit declaration of function `pthread_mutex_unlock' ../../gcc-3.4.0/gcc/gthr-posix.h:510: error: `mutex' undeclared (first use in this function) make[2]: *** [libgcc/./unwind-dw2.o] Error 1 make[2]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make[1]: *** [libgcc.a] Error 2 make[1]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make: *** [all-gcc] Error 2 From lrtaylor@micron.com Mon Aug 16 19:24:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Mon, 16 Aug 2004 19:24:00 -0000 Subject: problem when building gcc 4.3.0 Message-ID: <363801FFD7B74240A329CEC3F7FE4CC4030960BA@ntxboimbx07.micron.com> Have you tried the configure option for disabling thread support? --disable-threads Just a thought - don't know if it will actually help in this case, though... Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Rongjun Lu Sent: Monday, August 16, 2004 11:05 AM To: gcc-help@gcc.gnu.org Subject: problem when building gcc 4.3.0 Dear Sir: when I build the gcc 4.3.0 for bootloader cross-compiler, the building process failed with pthread errors.Is there any one can tell me why? Thanks. I configured the gcc as following: ../build-gcc/configure --target=arm-linux \ >--prefix=/home/lurj/board_tms5471/tools --without-headers --with-newlib \ >--enable-languages=c then make all-gcc the error are following: ......... arm-linux-ranlib ./libgcov.a /home/lurj/board_tms5471/build-tools/build-gcc/gcc/xgcc -B/home/lurj/board_tms5471/build-tools/build-gcc/gcc/ -B//home/lurj/board_tms5471/tools/arm-linux/bin/ -B//home/lurj/board_tms5471/tools/arm-linux/lib/ -isystem //home/lurj/board_tms5471/tools/arm-linux/include -isystem //home/lurj/board_tms5471/tools/arm-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fomit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-3.4.0/gcc -I../../gcc-3.4.0/gcc/. -I../../gcc-3.4.0/gcc/../include -fexceptions -c ../../gcc-3.4.0/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o In file included from ./gthr-default.h:1, from ../../gcc-3.4.0/gcc/gthr.h:96, from ../../gcc-3.4.0/gcc/unwind-dw2.c:42: ../../gcc-3.4.0/gcc/gthr-posix.h:43:21: pthread.h: No such file or directory ../../gcc-3.4.0/gcc/gthr-posix.h:44:20: unistd.h: No such file or directory In file included from ./gthr-default.h:1, from ../../gcc-3.4.0/gcc/gthr.h:96, from ../../gcc-3.4.0/gcc/unwind-dw2.c:42: ../../gcc-3.4.0/gcc/gthr-posix.h:46: error: parse error before "__gthread_key_t" ../../gcc-3.4.0/gcc/gthr-posix.h:46: warning: type defaults to `int' in declaration of `__gthread_key_t' ../../gcc-3.4.0/gcc/gthr-posix.h:46: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h:47: error: parse error before "__gthread_once_t" ../../gcc-3.4.0/gcc/gthr-posix.h:47: warning: type defaults to `int' in declaration of `__gthread_once_t' ../../gcc-3.4.0/gcc/gthr-posix.h:47: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h:48: error: parse error before "__gthread_mutex_t" ../../gcc-3.4.0/gcc/gthr-posix.h:48: warning: type defaults to `int' in declaration of `__gthread_mutex_t' ../../gcc-3.4.0/gcc/gthr-posix.h:48: warning: data definition has no type or storage class ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_active_p': ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: `pthread_create' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: (Each undeclared identifier is reported only once ../../gcc-3.4.0/gcc/gthr-posix.h:96: error: for each function it appears in.) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:456: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:456: error: parse error before ')' token ../../gcc-3.4.0/gcc/gthr-posix.h:465: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:465: error: parse error before ')' token ../../gcc-3.4.0/gcc/gthr-posix.h:471: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:472: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_key_delete': ../../gcc-3.4.0/gcc/gthr-posix.h:472: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:473: warning: implicit declaration of function `pthread_key_delete' ../../gcc-3.4.0/gcc/gthr-posix.h:473: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:477: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:478: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_getspecific': ../../gcc-3.4.0/gcc/gthr-posix.h:478: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:479: warning: implicit declaration of function `pthread_getspecific' ../../gcc-3.4.0/gcc/gthr-posix.h:479: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:479: warning: return makes pointer from integer without a cast ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:483: error: parse error before "key" ../../gcc-3.4.0/gcc/gthr-posix.h:484: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_setspecific': ../../gcc-3.4.0/gcc/gthr-posix.h:484: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:485: warning: implicit declaration of function `pthread_setspecific' ../../gcc-3.4.0/gcc/gthr-posix.h:485: error: `key' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h:485: error: `ptr' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:489: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:490: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_lock': ../../gcc-3.4.0/gcc/gthr-posix.h:490: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:492: warning: implicit declaration of function `pthread_mutex_lock' ../../gcc-3.4.0/gcc/gthr-posix.h:492: error: `mutex' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:498: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:499: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_trylock': ../../gcc-3.4.0/gcc/gthr-posix.h:499: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:501: warning: implicit declaration of function `pthread_mutex_trylock' ../../gcc-3.4.0/gcc/gthr-posix.h:501: error: `mutex' undeclared (first use in this function) ../../gcc-3.4.0/gcc/gthr-posix.h: At top level: ../../gcc-3.4.0/gcc/gthr-posix.h:507: error: parse error before '*' token ../../gcc-3.4.0/gcc/gthr-posix.h:508: warning: function declaration isn't a prototype ../../gcc-3.4.0/gcc/gthr-posix.h: In function `__gthread_mutex_unlock': ../../gcc-3.4.0/gcc/gthr-posix.h:508: warning: old-style parameter declaration ../../gcc-3.4.0/gcc/gthr-posix.h:510: warning: implicit declaration of function `pthread_mutex_unlock' ../../gcc-3.4.0/gcc/gthr-posix.h:510: error: `mutex' undeclared (first use in this function) make[2]: *** [libgcc/./unwind-dw2.o] Error 1 make[2]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make[1]: *** [libgcc.a] Error 2 make[1]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make: *** [all-gcc] Error 2 From helm@fs.tum.de Mon Aug 16 23:54:00 2004 From: helm@fs.tum.de (Alexander Helm) Date: Mon, 16 Aug 2004 23:54:00 -0000 Subject: Optimized code with GCC-3.3.3 In-Reply-To: <1092670127.4120d2af702b0@webmail.welho.com> References: <1092670127.4120d2af702b0@webmail.welho.com> Message-ID: <412101AC.2080800@fs.tum.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, march includes mcpu. Or mathematically march => mcpu (this is what implies means). CU Alexander petsku86@welho.com wrote: | Hi! | I am trying to optimize to code produced by gcc-3.3.3 for my pentium4. | After reading the following manual page a got a little confused. | | http://tinyurl.com/5zt9b | | Does -march=cpu-type mean that a I automaticly have also -mcpu or do I have | to specify them both to get the best possible code? Imply is a verb which | when translated to my language (Finnish) could mean that it comes automaticly | or it needs to be specified. I tried using google but I didn't get any | answers there because I saw the -march option used both with and without | -mcpu. Thanks in advance. | | Regards, | Petteri R??ty -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBIQGsgRDwdtJH/NcRAlQ1AJ0eithYpzo656EKoS5aRDh6pPm//QCggQT5 rJL1E7lWsL2ufPowC2rLoxk= =MoHR -----END PGP SIGNATURE----- From jd2419@sbc.com Tue Aug 17 11:30:00 2004 From: jd2419@sbc.com (DY, JERRY U (SBCSI)) Date: Tue, 17 Aug 2004 11:30:00 -0000 Subject: Help with specs Message-ID: Here's my config: g++ -v Reading specs from /usr/local/appl/gcc-3.4.1/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.1/specs Configured with: ../gcc-3.4.1/configure --prefix=/usr/local/appl/gcc --with-as=/usr/local/appl/binutils/bin/as --enable-threa ds=posix Thread model: posix gcc version 3.4.1 I wanted to change the specs so that -D_INCLUDE__STDC_A1_SOURCE is defined everytime the precompiler is invoked, so I modify the cpp entry in the specs file as follows: *cpp: -D_INCLUDE__STDC_A1_SOURCE %{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L} But it doesn't appear to be working. Is there something wrong with my syntax or am I missing something? Thanks! -Jerry From trick@icculus.org Tue Aug 17 13:54:00 2004 From: trick@icculus.org (Gerry) Date: Tue, 17 Aug 2004 13:54:00 -0000 Subject: Creating executable shared libraries ? In-Reply-To: References: <200408132145.56429.trick@icculus.org> Message-ID: <200408170154.50007.trick@icculus.org> mandag 16 august 2004, 17:42, skrev Segher Boessenkool: > See http://gcc.gnu.org/ml/gcc-help/2003-07/msg00232.html . Thanks, but I'm still having problems. The shared library can now be run and call functions without a problem, but argc and argv are garbage. This is a problem, because the main function needs to know its invocation name, and it also takes arguments. I suppose I can use readlink with /proc/self/exe to get the executable name at least, and possibly /proc/self/cmdline for the arguments (gotta try that), but is there another (better) way ? (Also, returning from main segfaults, is that normal ? Not that *that*'s a problem, setting return type to void and just using exit works fine). Also, I had to change "/lib/ld.so.1" to "/lib/ld-linux.so.2" since the first one doesn't exist on my box ("ld-linux.so.2" is a symlink to "ld-2.3.2.so"). Is there a way to have this work with both (or any ld.so's) without a recompile ? The lib is open source, so compile-time config isn't a problem, but it'd be nice if pre-compiled binaries could support both. (Tried using multiple .interp strings, but that didn't seem to work.) Here's a test program, compiled with (seem to remember that -DPIC from somewhere, don't know if it's necessary ?) gcc -W -Wall -fPIC -DPIC -shared test.c -o test -Wl,-e,my_main -- 8< -- #include #include const char interp[] __attribute__((section(".interp"))) = "/lib/ld-linux.so.2"; void my_main (int argc, char *argv[]) { printf("argc = %i (%u)\nargv = %p\n", argc, argc, argv); printf("*argv = %s\n", *argv); exit(0); } -- 8< -- Output (the numbers at argc/argv are constant for same arguments, but change for different args -- the difference in values seems to hint that the args are stored, but the address isn't readable): -- 8< -- $ ./test argc = -1073744275 (3221223021) argv = (nil) Segmentation fault $ ./test 1 argc = -1073744277 (3221223019) argv = 0xbffff672 Segmentation fault $ ./test 1 2 argc = -1073744279 (3221223017) argv = 0xbffff670 Segmentation fault $ ./test 1 23 argc = -1073744280 (3221223016) argv = 0xbffff66f Segmentation fault -- 8< -- Any ideas ? (Thought about using mprotect, but that seems a bit, eh, hackish and insecure..) - Gerry From segher@kernel.crashing.org Tue Aug 17 15:34:00 2004 From: segher@kernel.crashing.org (Segher Boessenkool) Date: Tue, 17 Aug 2004 15:34:00 -0000 Subject: Creating executable shared libraries ? In-Reply-To: <200408170154.50007.trick@icculus.org> References: <200408132145.56429.trick@icculus.org> <200408170154.50007.trick@icculus.org> Message-ID: >> See http://gcc.gnu.org/ml/gcc-help/2003-07/msg00232.html . > > Thanks, but I'm still having problems. The shared library can now be > run and > call functions without a problem, but argc and argv are garbage. I never had that problem -- are you sure it really gets it wrong, and it is not just gdb not showing you the right stuff? Or maybe your arch needs a bit more init or something. > (Also, returning from main segfaults, is that normal ? No. > Also, I had to change "/lib/ld.so.1" to "/lib/ld-linux.so.2" since the > first > one doesn't exist on my box ("ld-linux.so.2" is a symlink to > "ld-2.3.2.so"). Yeah, this example code was on an older ppc32-linux system. > Is there a way to have this work with both (or any ld.so's) without a > recompile ? The lib is open source, so compile-time config isn't a > problem, > but it'd be nice if pre-compiled binaries could support both. (Tried > using > multiple .interp strings, but that didn't seem to work.) You need the exact same version of ld.so and libc.so anyway, so just have the right one found at compile time -- don't know how to do that the easy way, sorry. Segher From jmah@caduc.com Tue Aug 17 16:22:00 2004 From: jmah@caduc.com (Joseph Mah) Date: Tue, 17 Aug 2004 16:22:00 -0000 Subject: Dependency line needs colon or double colon? Message-ID: <023101c48461$6ac0f060$515aa8c0@WNYCCAD105283JM> Hello, I am trying to compile gcc and am using gnu Make 3.8.0: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap in AIX 4.3.3 I am getting a series of errors as follows. I've checked through the Makefile itself but I don't understand what is wrong. Is there a certain format or set of spaces, tabs required? ---------------------------------- Target "all" is up to date. Target "all" is up to date. : make ; exec true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" " CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=-O2 -g -O2" "INSTALL= /opt/gcc-3.4.1/install-sh -c" "INSTALL_DATA=/opt/gcc-3.4.1/install-sh -c -m 644 " "INSTALL_PROGRAM=/opt/gcc-3.4.1/install-sh -c" "INSTALL_SCRIPT=/opt/gcc-3.4. 1/install-sh -c" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-O2 -g - O2" "MAKE=make" "MAKEINFO=/opt/gcc-3.4.1/missing makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTES T=runtest" "RUNTESTFLAGS=" "exec_prefix=/usr/local" "infodir=/usr/local/info" "libdir=/usr/local/lib" "prefix=/usr/local" "tooldir=/usr/local/powerpc-ibm- aix4.3.3.0" "AR=ar" "AS=as" "CC=gcc" "CXX=c++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do Target "all" is up to date. Bootstrapping the compiler "Makefile", line 732: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 733: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 734: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 735: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 736: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 737: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 738: make: 1254-055 Dependency line needs colon or double c olon operator. "Makefile", line 739: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 740: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 741: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 742: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 743: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 744: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 745: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 746: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 747: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 748: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 749: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 933: make: 1254-055 Dependency line needs colon or double colon operator. "/opt/gcc-3.4.1/gcc/cp/Make-lang.in", line 127: make: 1254-055 Dependency line n eeds colon or double colon operator. "Makefile", line 935: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 941: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 943: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 946: make: 1254-055 Dependency line needs colon or double colon operator. "", line 0: make: 1254-027 Cannot open . "Makefile", line 948: make: 1254-055 Dependency line needs colon or double colon operator. make: 1254-058 Fatal errors encountered -- cannot continue. make: 1254-004 The error code from the last command is 2. From iainw@nortelnetworks.com Tue Aug 17 17:19:00 2004 From: iainw@nortelnetworks.com (Iain Woolf) Date: Tue, 17 Aug 2004 17:19:00 -0000 Subject: Which version of bison needed to build gcc2.95(ish) Message-ID: <41222598.9090505@americasm01.nt.com> Hi, I'm trying to build gcc2.96 on a linux box (redhat with kernel 2.4.18-27.7.x) from the source provided by WindRiver and have run into a problem with the bison stage of the build. Initially it was giving me errors missing semi-colons. I saw from various mailing list archives that this was a common error when building gcc pre-v3.0 using bison post-v1.34, so I installed bison v1.33. Now bison will process the file, but finds a different number of shift/reduce conflicts than expected: ... cd ../../gcc/objc; \ bison -o objc-parse.c objc-parse.y objc-parse.y contains 72 shift/reduce conflicts. expected 66 shift/reduce conflicts make[1]: *** [../../gcc/objc/objc-parse.c] Error 1 Does anyone know what version of bison will give the right number? Alternatively is there any other way to get past this? (I've tried commenting out the "%expect 66" line, but run into another error later on which I suspect is related to me bypassing this parsing issue) Any help appreciated. Cheers, Iain From lrtaylor@micron.com Tue Aug 17 21:34:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Tue, 17 Aug 2004 21:34:00 -0000 Subject: Dependency line needs colon or double colon? Message-ID: <363801FFD7B74240A329CEC3F7FE4CC4030960CC@ntxboimbx07.micron.com> Are you using GNU make or AIX's make? You need to be using GNU make. Run 'make -v' to find out. If it's GNU, you'll know based on the output. If it gives you an error, then it's not GNU make. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Joseph Mah Sent: Tuesday, August 17, 2004 7:52 AM To: gcc-help@gcc.gnu.org Subject: Dependency line needs colon or double colon? Hello, I am trying to compile gcc and am using gnu Make 3.8.0: make CFGLAGS='-O' LIBCFLAGS='-g -O2' \LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap in AIX 4.3.3 I am getting a series of errors as follows. I've checked through the Makefile itself but I don't understand what is wrong. Is there a certain format or set of spaces, tabs required? ---------------------------------- Target "all" is up to date. Target "all" is up to date. : make ; exec true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" " CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=-O2 -g -O2" "INSTALL= /opt/gcc-3.4.1/install-sh -c" "INSTALL_DATA=/opt/gcc-3.4.1/install-sh -c -m 644 " "INSTALL_PROGRAM=/opt/gcc-3.4.1/install-sh -c" "INSTALL_SCRIPT=/opt/gcc-3.4. 1/install-sh -c" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-O2 -g - O2" "MAKE=make" "MAKEINFO=/opt/gcc-3.4.1/missing makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTES T=runtest" "RUNTESTFLAGS=" "exec_prefix=/usr/local" "infodir=/usr/local/info" "libdir=/usr/local/lib" "prefix=/usr/local" "tooldir=/usr/local/powerpc-ibm- aix4.3.3.0" "AR=ar" "AS=as" "CC=gcc" "CXX=c++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do Target "all" is up to date. Bootstrapping the compiler "Makefile", line 732: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 733: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 734: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 735: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 736: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 737: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 738: make: 1254-055 Dependency line needs colon or double c olon operator. "Makefile", line 739: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 740: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 741: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 742: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 743: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 744: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 745: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 746: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 747: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 748: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 749: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 933: make: 1254-055 Dependency line needs colon or double colon operator. "/opt/gcc-3.4.1/gcc/cp/Make-lang.in", line 127: make: 1254-055 Dependency line n eeds colon or double colon operator. "Makefile", line 935: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 941: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 943: make: 1254-055 Dependency line needs colon or double colon operator. "Makefile", line 946: make: 1254-055 Dependency line needs colon or double colon operator. "", line 0: make: 1254-027 Cannot open . "Makefile", line 948: make: 1254-055 Dependency line needs colon or double colon operator. make: 1254-058 Fatal errors encountered -- cannot continue. make: 1254-004 The error code from the last command is 2. From krisma-jean_jablonski@expresso.com.br Wed Aug 18 06:42:00 2004 From: krisma-jean_jablonski@expresso.com.br (Krisma-jean_jablonski) Date: Wed, 18 Aug 2004 06:42:00 -0000 Subject: Compiler Message-ID: Hi, my Name is Jean and I need help to compiler a source to an executable (rbatfile.exe) for DEC Alpha 21064 APX on windows NT 4.0 SP6. ________________________________________________ This mail was sent by Webmail Expresso 2.5 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: rbatfile.c URL: From dr_moreira@yahoo.com.br Wed Aug 18 07:18:00 2004 From: dr_moreira@yahoo.com.br (=?iso-8859-1?q?daniel=20rangel?=) Date: Wed, 18 Aug 2004 07:18:00 -0000 Subject: Dummy problem when linking Message-ID: <20040817213435.36420.qmail@web14627.mail.yahoo.com> Hi, i have two objs (that i would like to make a lib): rddpgsql.c rddpgsql0.c and im trying to link this files against a source file (tstconn.c) that will use symbos that belongs to the two file above with the following command: gcc -otstconn -I/usr/include/xharbour -L/usr/lib/xharbour -lpq -lxharbour -lslang rddpgsql.o rddpgsql0.o tstconn.c and it tells me that there is unresolved symbols on tstconn.c that are the symbols presente in the rddpgsql.o(i saw them with nm) and the weird is that if i put the statement '-lpq' after tstconn.c i get unresolved symbols from libpq like ssl and krb5 functions called by that lib. could anyone give me a clue on what is happening? best regards, []??s daniel rangel moreira _______________________________________________________ Yahoo! Acesso Gr??tis - navegue de gra??a com conex??o de qualidade! Acesse: http://br.acesso.yahoo.com/ From suresh@comodogroup.com Wed Aug 18 08:56:00 2004 From: suresh@comodogroup.com (L.Suresh) Date: Wed, 18 Aug 2004 08:56:00 -0000 Subject: Problem with std::ostringstream operator<<(long) Message-ID: <1092811333.5322.36.camel@Ironwing> Hi, I'm getting a segmentation fault in my program when using std::ostringstream. Code excertps: std::ostringstream ostr; ostr << pInfo.getPacketId(); // <-- Offending line. calls op<<(long) ... Output few more strings ..... std::cout << ostr.str() << std::endl GDB: Stack trace #0 0x0075cdb2 in _int_malloc () from /lib/tls/libc.so.6 #1 0x0075c10d in malloc () from /lib/tls/libc.so.6 #2 0x00b7c80e in operator new(unsigned) () from /usr/lib/libstdc++.so.5 #3 0x00b68c49 in std::__default_alloc_template::allocate(unsigned) () from /usr/lib/libstdc++.so.5 #4 0x00b6e678 in std::string::_Rep::_S_create(unsigned, std::allocator const&) () from /usr/lib/libstdc++.so.5 #5 0x00b6e749 in std::string::_Rep::_M_clone(std::allocator const&, unsigned) () from /usr/lib/libstdc++.so.5 #6 0x00b6c3bd in std::string::reserve(unsigned) () from /usr/lib/libstdc++.so.5 #7 0x00b6347f in std::basic_stringbuf, std::allocator >::overflow(int) () from /usr/lib/libstdc++.so.5 #8 0x00b69ee4 in std::basic_streambuf >::xsputn(char const*, int) () from /usr/lib/libstdc++.so.5 #9 0x00b499ff in std::ostreambuf_iterator > std::num_put > >::_M_convert_int(std::ostreambuf_iterator >, std::ios_base&, char, long) const () from /usr/lib/libstdc++.so.5 #10 0x00b495e0 in std::num_put > >::do_put(std::ostreambuf_iterator >, std::ios_base&, char, long) const () from /usr/lib/libstdc++.so.5 #11 0x00b5ef9c in std::ostream::operator<<(long) () #12 0x0806a99b in Engine::NullEngine::analyze(NA::PacketInfo const&) ( this=0x8f9c860, pInfo=@0x8fe3058) at packetinfo.h:146 #13 0x080721c6 in App::WorkerThreadTask::run(Thread*) (this=0x9062860, th=0x9072fc0) at ../application/workerthreadtask.cpp:39 #14 0x0804fe50 in Thread::start(void*) (data=0x9072fc0) at ../util/thread.cpp:122 #15 0x0097b79c in start_thread () from /lib/tls/libpthread.so.0 #16 0x007c827a in clone () from /lib/tls/libc.so.6 From michal017@centrum.sk Wed Aug 18 09:05:00 2004 From: michal017@centrum.sk (m.) Date: Wed, 18 Aug 2004 09:05:00 -0000 Subject: Problem with std::ostringstream operator<<(long) In-Reply-To: <1092811333.5322.36.camel@Ironwing> References: <1092811333.5322.36.camel@Ironwing> Message-ID: <412302BF.8090506@centrum.sk> I had similar problems when compiling threaded applications with gcc that was compiled with thread model single. m. L.Suresh wrote: > Hi, > I'm getting a segmentation fault in my program when using > std::ostringstream. > > Code excertps: > > std::ostringstream ostr; > ostr << pInfo.getPacketId(); // <-- Offending line. calls op<<(long) > > ... Output few more strings ..... > > std::cout << ostr.str() << std::endl > > > GDB: Stack trace > > #0 0x0075cdb2 in _int_malloc () from /lib/tls/libc.so.6 > #1 0x0075c10d in malloc () from /lib/tls/libc.so.6 > #2 0x00b7c80e in operator new(unsigned) () from /usr/lib/libstdc++.so.5 > #3 0x00b68c49 in std::__default_alloc_template 0>::allocate(unsigned) () > from /usr/lib/libstdc++.so.5 > #4 0x00b6e678 in std::string::_Rep::_S_create(unsigned, > std::allocator const&) () from /usr/lib/libstdc++.so.5 > #5 0x00b6e749 in std::string::_Rep::_M_clone(std::allocator > const&, unsigned) () from /usr/lib/libstdc++.so.5 > #6 0x00b6c3bd in std::string::reserve(unsigned) () > from /usr/lib/libstdc++.so.5 > #7 0x00b6347f in std::basic_stringbuf, > std::allocator >::overflow(int) () from /usr/lib/libstdc++.so.5 > #8 0x00b69ee4 in std::basic_streambuf > >>::xsputn(char const*, int) () from /usr/lib/libstdc++.so.5 > > #9 0x00b499ff in std::ostreambuf_iterator > >>std::num_put > std::char_traits > > >>::_M_convert_int(std::ostreambuf_iterator > std::char_traits >, std::ios_base&, char, long) const () from > /usr/lib/libstdc++.so.5 > #10 0x00b495e0 in std::num_put std::char_traits > >::do_put(std::ostreambuf_iterator std::char_traits >, std::ios_base&, char, long) const () from > /usr/lib/libstdc++.so.5 > #11 0x00b5ef9c in std::ostream::operator<<(long) () > #12 0x0806a99b in Engine::NullEngine::analyze(NA::PacketInfo const&) ( > this=0x8f9c860, pInfo=@0x8fe3058) at packetinfo.h:146 > #13 0x080721c6 in App::WorkerThreadTask::run(Thread*) (this=0x9062860, > th=0x9072fc0) at ../application/workerthreadtask.cpp:39 > #14 0x0804fe50 in Thread::start(void*) (data=0x9072fc0) > at ../util/thread.cpp:122 > #15 0x0097b79c in start_thread () from /lib/tls/libpthread.so.0 > #16 0x007c827a in clone () from /lib/tls/libc.so.6 > > > > From ashok.anand@gmail.com Wed Aug 18 11:25:00 2004 From: ashok.anand@gmail.com (Ashok Anand) Date: Wed, 18 Aug 2004 11:25:00 -0000 Subject: INT_TYPE_SIZE 32 to 16 Message-ID: <854da8df0408180156ecfa777@mail.gmail.com> hi, I am facing a problem while building gcc. I only changed value of INT_TYPE_SIZE defined in file gcc-3.4.1\gcc\config\i386\i386.h to 16, specifying that int size is 16 bits instead of 32 bits, When i ran make , it didn't build and gave errors. This was the only change i made. Please tell me how i can specify int size to be 16 bits rather than 32 bits. regex.c: At top level: regex.c:8178: warning: unused parameter 'preg' regex.c: In function `byte_re_match_2_internal': regex.c:7576: error: unrecognizable insn: (insn:HI 2861 6401 2862 228 regex.c:7833 (parallel [ (set (reg:SI 1211 [ mcnt ]) (zero_extend:DI (subreg:HI (reg/v:SI 71 [ mcnt ]) 0))) (clobber (reg:CC 17 flags)) ]) -1 (nil) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))) regex.c:7576: internal compiler error: in extract_insn, at recog.c:2083 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make[1]: *** [regex.o] Error 1 make[1]: Leaving directory `/cygdrive/e/gcc/gcc-3.4.1/i686-pc-cygwin/libiberty' make: *** [all-target-libiberty] Error 2 With regards, -ashok From ankitjain1580@yahoo.com Wed Aug 18 13:59:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Wed, 18 Aug 2004 13:59:00 -0000 Subject: INT_TYPE_SIZE 32 to 16 In-Reply-To: <854da8df0408180156ecfa777@mail.gmail.com> Message-ID: <20040818090535.50077.qmail@web52901.mail.yahoo.com> hi well i dont understand why u need to decrease the size of int in linux. what u could have simply done is use int16_t or uint16_t for unsigned integer. it will work fine all u have to do is add inttypes.h header file bye ankit --- Ashok Anand wrote: > hi, > > I am facing a problem while building gcc. I > only changed value of > INT_TYPE_SIZE defined in file > gcc-3.4.1\gcc\config\i386\i386.h > to 16, specifying that int size is 16 bits > instead of 32 bits, > When i ran make , it didn't build and gave errors. > This was the only > change i made. Please tell me how i can specify > int size to be 16 > bits rather than 32 bits. > > regex.c: At top level: > regex.c:8178: warning: unused parameter 'preg' > regex.c: In function `byte_re_match_2_internal': > regex.c:7576: error: unrecognizable insn: > (insn:HI 2861 6401 2862 228 regex.c:7833 (parallel [ > (set (reg:SI 1211 [ mcnt ]) > (zero_extend:DI (subreg:HI (reg/v:SI > 71 [ mcnt ]) 0))) > (clobber (reg:CC 17 flags)) > ]) -1 (nil) > (expr_list:REG_UNUSED (reg:CC 17 flags) > (nil))) > regex.c:7576: internal compiler error: in > extract_insn, at recog.c:2083 > Please submit a full bug report, > with preprocessed source if appropriate. > See for > instructions. > make[1]: *** [regex.o] Error 1 > make[1]: Leaving directory > `/cygdrive/e/gcc/gcc-3.4.1/i686-pc-cygwin/libiberty' > make: *** [all-target-libiberty] Error 2 > > With regards, > -ashok > ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From eljay@adobe.com Wed Aug 18 14:12:00 2004 From: eljay@adobe.com (John Love-Jensen) Date: Wed, 18 Aug 2004 14:12:00 -0000 Subject: Dummy problem when linking In-Reply-To: <20040817213435.36420.qmail@web14627.mail.yahoo.com> Message-ID: Hi Daniel, I believe the order in the command line is important. The symbols are "unresolved" because when the linker sees the symbol, nothing requires it so it doesn't include it, then LATER a file needs the symbol... but it's not a two-pass link, and the symbol isn't seen again. Thus, unresolved. Order is important. Put the unresolved items BEFORE, and the thing that supplies the unresolved items AFTER. HTH, --Eljay From fulldecent@gmail.com Wed Aug 18 15:00:00 2004 From: fulldecent@gmail.com (Full Decent) Date: Wed, 18 Aug 2004 15:00:00 -0000 Subject: Feature request: incremental compiling Message-ID: I request gcc to have the feature of incremental compiling: Gcc should have an option to compile source by reading line-for-line rather than buffering the whole file. This would allow you to essentially cat | gcc - and watch errors/warnings come up as you type in code. The advantage of this feature would be amazing for IDE's, they could offer realtime hilighting of error/warning lines in code. From eljay@adobe.com Thu Aug 19 07:34:00 2004 From: eljay@adobe.com (John Love-Jensen) Date: Thu, 19 Aug 2004 07:34:00 -0000 Subject: Feature request: incremental compiling In-Reply-To: Message-ID: Hi Full Decent, Eclipse 3.0 IDE with CDT 2.0 offers nearly real-time highlighting of error/warning lines in C/C++ code. CDT stands for "C/C++ Development Tools", a plug-in for the Eclipse IDE platform. Eclipse is the best IDE I've used. And usually, I eschew IDE's in favor of Vim. (Now only if the Vim editor was a free-and-well-integrated plug-in for Eclipse. But alas.) Sincerely, --Eljay From Rongjun.Lu@cern.ch Thu Aug 19 11:19:00 2004 From: Rongjun.Lu@cern.ch (Rongjun Lu) Date: Thu, 19 Aug 2004 11:19:00 -0000 Subject: error in building gcc 2.95.3 Message-ID: <3FC7FEE5A901664193468E8F63AFE1EA4D30F0@cernxchg15.cern.ch> Dear Sir: After failing to compile gcc3.4.0,I chang to gcc2.95.3 with binutils 2.10.1. Building binutils is successful, and the gcc is almost successful.The error is as following, but I don't know where is "asm/unistd.h"is from. How to resovle it? Thanks. configure gcc as: ../gcc-2.95.3/config --target=arm-linux --prefix=/home/lurj/board_tms5471/tools --without-headers --with-newlib --enable-languages=c error: --------------------------------------------- ............ rm -f tmplibgcc1.a libgcc1.S cp ../../gcc-2.95.3/gcc/config/arm/lib1funcs.asm libgcc1.S for name in _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx; \ do \ echo ${name}; \ /home/lurj/board_tms5471/build-tools/build-gcc/gcc/xgcc -B/home/lurj/board_tms5471/build-tools/build-gcc/gcc/ -B/home/lurj/board_tms5471/tools/arm-linux/bin/ -I/home/lurj/board_tms5471/tools/arm-linux/include -O2 -DCROSS_COMPILE -DIN_GCC -g -O2 -I./include -fomit-frame-pointer -fPIC -Dinhibit_libc -D__gthr_posix_h -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I../../gcc-2.95.3/gcc -I../../gcc-2.95.3/gcc/config -I../../gcc-2.95.3/gcc/../include -c -DL${name} libgcc1.S; \ if [ $? -eq 0 ] ; then true; else exit 1; fi; \ mv libgcc1.o ${name}.o; \ arm-linux-ar rc tmplibgcc1.a ${name}.o; \ rm -f ${name}.o; \ done _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx libgcc1.S:438: asm/unistd.h: No such file or directory make[1]: *** [libgcc1-asm.a] Error 1 make[1]: Leaving directory `/home/lurj/board_tms5471/build-tools/build-gcc/gcc' make: *** [all-gcc] Error 2 ---------------------------------------------- From ankitjain1580@yahoo.com Thu Aug 19 15:27:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Thu, 19 Aug 2004 15:27:00 -0000 Subject: assembler error Message-ID: <20040819073419.5358.qmail@web52903.mail.yahoo.com> 1 #include 2 int main() 3 { 4 uint8_t a[32]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27, 28,29,30,31,32},i=0,b[32],j=0; 5 for(i=0;i<32;i=i+8) 6 { 7 asm("movq (%1), %%mm0 \n\t" 8 "movq %%mm0, (%0) \n\t" 9 :"=r"(b[i]) 10 :"r"(a[i]) 11 :"%mm0" 12 ); 13 while(j<32) 14 {printf("%d ",b[j]);j++;} 15 } 16 return 0; 17 } this gives a assembler error? /tmp/ccO1Jllb.s: Assembler messages: /tmp/ccO1Jllb.s:68: Error: `(%al)' is not a valid 32 bit base/index expression /tmp/ccO1Jllb.s:69: Error: `(%al)' is not a valid 32 bit base/index expression WHY? ankit jain ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From eljay@adobe.com Thu Aug 19 15:55:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 19 Aug 2004 15:55:00 -0000 Subject: assembler error References: <20040819073419.5358.qmail@web52903.mail.yahoo.com> Message-ID: <00ca01c485de$68459100$a8b2f882@PS253> Hi Ankit, Your a[32] array and b[32] array are not stored in registers, they are stored in memory. But you are using a "r" specifier instead of a "m" specifier. I changed your example to use "m", and set b to all 255, and also changed the printf loop to print each time instead of just the first time, and then the assembly snippet copied a to b in four iterations. HTH, --Eljay From balan@myway.com Thu Aug 19 16:21:00 2004 From: balan@myway.com (balan) Date: Thu, 19 Aug 2004 16:21:00 -0000 Subject: question Message-ID: <20040819152750.0BBE53998@mprdmxin.myway.com> Hi This is balan frm chennai, i getting more help from the site http://gcc.gnu.org pertaining to Gnu C++ Compiler and thanx Answer to my question pls What is abrevation of GNU ? with regards balan _______________________________________________ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com From eljay@adobe.com Thu Aug 19 16:27:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 19 Aug 2004 16:27:00 -0000 Subject: question In-Reply-To: <20040819152750.0BBE53998@mprdmxin.myway.com> References: <20040819152750.0BBE53998@mprdmxin.myway.com> Message-ID: <6.1.2.0.2.20040819105452.01ecde78@iplan-mn.corp.adobe.com> Hi Balan, GNU - GNU's Not Unix --Eljay From jiayu@huawei.com Thu Aug 19 18:30:00 2004 From: jiayu@huawei.com (jiayu 33576) Date: Thu, 19 Aug 2004 18:30:00 -0000 Subject: Help! A C++ compiling error! Message-ID: We are using gcc 2.96 which is supplied by windriver with Tornado 2.2. The information is : C:/Tornado/host/x86-win32/include/g++-3/stl_iterator.h: In function `void distance (_InputIterator, _InputIterator, _Distance &) [with _InputIterator = _Rb_tree_iterator, pair &, pair *>, _Distance = size_t]': C:/Tornado/host/x86-win32/include/g++-3/stl_iterator.h:278: instantiated from `_Rb_tree_base, allocator >' C:/Tornado/host/x86-win32/include/g++-3/stl_map.h:76: instantiated from `_Rb_tree, _Select1st >, less, allocator >' C:/Tornado/host/x86-win32/include/g++-3/stl_map.h:76: instantiated from `map, allocator >' ../../../src/momu/src/mml/mml_cmdpara.h:247: instantiated from here C:/Tornado/host/x86-win32/include/g++-3/stl_iterator.h:278: Internal compiler error in `expand_call', at calls.c:3146 make: *** [obj/mml_cmdpara.obj] Error 0x1 mml_cmdpara.h: typedef map > T_MML_PARA_POS; ...... class T_MML_CMDPARA { ...... Line 247: T_MML_PARA_POS m_ParaPos; } The code can be compiled correctly in gcc 2.76 which is supplied by Tornado 2.0. I am confused. Please help me! Thanks a lot! name: jiayu email: jiayu@huawei.com ************************************************************** This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! ************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: j33576.vcf Type: text/x-vcard Size: 84 bytes Desc: Card for jiayu 33576 URL: From ian@wasabisystems.com Thu Aug 19 18:40:00 2004 From: ian@wasabisystems.com (Ian Lance Taylor) Date: Thu, 19 Aug 2004 18:40:00 -0000 Subject: Help! A C++ compiling error! In-Reply-To: References: Message-ID: jiayu 33576 writes: > We are using gcc 2.96 which is supplied by windriver with Tornado 2.2. That is a very old version--the current version is 3.4.1. Moreover there was no official gcc release with the version number 2.96--there was 2.95, but no 2.96, so we can not know what your actual compiler sources look like. I recommend that you contact Wind River for help with this. Ian From Vinita_Sinha@tesseract.com Thu Aug 19 18:44:00 2004 From: Vinita_Sinha@tesseract.com (Sinha, Vinita) Date: Thu, 19 Aug 2004 18:44:00 -0000 Subject: compile and link a C with embedded SQl program using gcc and DB2 Message-ID: <92F42ACDF6EDA547BA003A49A68A651E0B2D3E@tessmail.tesseract.com> Hi, I am trying to compile a simple sql program using c and DB2 . It fails in the link step.Which are the other Libraries I need to add in the link step to make it work ? This is the bat file for compile @echo off rem Licensed Materials - Property of IBM if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -I"C:\Program Files\SQLLIB\samples\cli" -O0 -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -L"C:\Program Files\SQLLIB\include" -L"C:\Program Files\SQLLIB\lib\db2api.lib" -L"C:\Program Files\SQLLIB\samples\c" -L"C:\Program Files\SQLLIB\bin" -o2006b.exe sqlexample.o goto exit The compile log with errors : C:\R20006\cPrograms>bldappgcc.bat sqlexample Replica1 db2admin db2admin Database Connection Information Database server = DB2/NT 8.1.0 SQL authorization ID = DB2ADMIN Local database alias = REPLICA1 LINE MESSAGES FOR sqlexample.sqc ------ -------------------------------------------------------------------- SQL0060W The "C" precompiler is in progress. SQL0091W Precompilation or binding was ended with "0" errors and "0" warnings. LINE MESSAGES FOR sqlexample.bnd ------ -------------------------------------------------------------------- SQL0061W The binder is in progress. SQL0091N Binding was ended with "0" errors and "0" warnings. DB20000I The SQL command completed successfully. C:\R20006\cPrograms>rem Compile the program. C:\R20006\cPrograms>if exist "sqlexample.cxx" goto cpp_emb C:\R20006\cPrograms>goto link_embedded C:\R20006\cPrograms>gcc -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\ SQLLIB\samples\c" -I"C:\Program Files\SQLLIB\samples\cli" -O0 -g3 -Wall -c -fmes sage-length=0 -osqlexample.o sqlexample.c sqlexample.sqc:73:18: warning: character constant too long for its type sqlexample.sqc:73:30: warning: character constant too long for its type sqlexample.sqc:73:42: warning: character constant too long for its type sqlexample.sqc: In function `main': sqlexample.sqc:73: warning: passing arg 1 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:73: warning: passing arg 2 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:73: warning: passing arg 3 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:87: warning: control reaches end of non-void function sqlexample.sqc: In function `TbBasicSelect': sqlexample.sqc:121: warning: unused variable `rc' C:\R20006\cPrograms>gcc -L"C:\Program Files\SQLLIB\include" -L"C:\Program Files\ SQLLIB\lib\db2api.lib" -L"C:\Program Files\SQLLIB\samples\c" -L"C:\Program File s\SQLLIB\bin" -o2006b.exe sqlexample.o sqlexample.o(.text+0xce): In function `main': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefined reference to `_sqlastr t@12' sqlexample.o(.text+0xfd):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefin ed reference to `_sqlacall@20' sqlexample.o(.text+0x10c):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefi ned reference to `_sqlastop@4' sqlexample.o(.text+0x24a): In function `DbConnect': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undefined reference to `_sqlast rt@12' sqlexample.o(.text+0x271):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x31c):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x34b):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x35a):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlastop@4' sqlexample.o(.text+0x380):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlastrt@12' sqlexample.o(.text+0x3a7):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x406):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x435):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x444):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlastop@4' sqlexample.o(.text+0x4b1): In function `TbBasicSelect': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undefined reference to `_sqlast rt@12' sqlexample.o(.text+0x4d8):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x538):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x567):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x576):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlastop@4' collect2: ld returned 1 exit status C:\R20006\cPrograms>rem link -debug -out:sqlexample.exe sqlexample.obj utilemb.o bj db2api.lib C:\R20006\cPrograms>goto exit The system cannot find the batch label specified - exit C:\R20006\cPrograms> Any help will be appreciated Thanks Vinita From eljay@adobe.com Fri Aug 20 06:49:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 20 Aug 2004 06:49:00 -0000 Subject: compile and link a C with embedded SQl program using gcc and DB2 In-Reply-To: <92F42ACDF6EDA547BA003A49A68A651E0B2D3E@tessmail.tesseract.com> References: <92F42ACDF6EDA547BA003A49A68A651E0B2D3E@tessmail.tesseract.com> Message-ID: <6.1.2.0.2.20040819133818.01e92790@iplan-mn.corp.adobe.com> Hi Vinita, The errors are DB2 errors, not GCC errors. Unless there happens to be somebody on this forum with DB2 experience in the particular environment you are working in (doubtful, but could happen), you'll probably have better luck inquiring on a DB2 help forum. Sincerely, --Eljay From gbras@anacomp.com Fri Aug 20 08:03:00 2004 From: gbras@anacomp.com (Bras, Gerard) Date: Fri, 20 Aug 2004 08:03:00 -0000 Subject: compile and link a C with embedded SQl program using gcc and DB2 Message-ID: <66911C8E1F2DA24EB29DE289297A135E1FC06C@usrd104.corp.anacomp.com> Vinita, You are lacking the "-l" lib directives on your link line. You have the "-L" directives which tell the link WHERE to look. But you also need to specify WHICH actual libraries to link in. I don't know a thing about DB2 on NT but my guess is it'll be pretty obvious when you look in If it isn't there is always the DB2 web site which I'm has what you're looking for. Acutally, now that I look closer you seem to have tried to combine bothe functions into a single "-L" directive. Try changing: -L"C:\Program Files\SQLLIB\lib\db2api.lib into -L"C:\Program Files\SQLLIB\lib" -ldb2api.lib Best of luck. Gerard Bras -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Sinha, Vinita Sent: Thursday, August 19, 2004 2:30 PM To: gcc-help@gcc.gnu.org Subject: compile and link a C with embedded SQl program using gcc and DB2 Hi, I am trying to compile a simple sql program using c and DB2 . It fails in the link step.Which are the other Libraries I need to add in the link step to make it work ? This is the bat file for compile @echo off rem Licensed Materials - Property of IBM if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -I"C:\Program Files\SQLLIB\samples\cli" -O0 -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -L"C:\Program Files\SQLLIB\include" -L"C:\Program Files\SQLLIB\lib\db2api.lib" -L"C:\Program Files\SQLLIB\samples\c" -L"C:\Program Files\SQLLIB\bin" -o2006b.exe sqlexample.o goto exit The compile log with errors : C:\R20006\cPrograms>bldappgcc.bat sqlexample Replica1 db2admin db2admin Database Connection Information Database server = DB2/NT 8.1.0 SQL authorization ID = DB2ADMIN Local database alias = REPLICA1 LINE MESSAGES FOR sqlexample.sqc ------ -------------------------------------------------------------------- SQL0060W The "C" precompiler is in progress. SQL0091W Precompilation or binding was ended with "0" errors and "0" warnings. LINE MESSAGES FOR sqlexample.bnd ------ -------------------------------------------------------------------- SQL0061W The binder is in progress. SQL0091N Binding was ended with "0" errors and "0" warnings. DB20000I The SQL command completed successfully. C:\R20006\cPrograms>rem Compile the program. C:\R20006\cPrograms>if exist "sqlexample.cxx" goto cpp_emb C:\R20006\cPrograms>goto link_embedded C:\R20006\cPrograms>gcc -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\ SQLLIB\samples\c" -I"C:\Program Files\SQLLIB\samples\cli" -O0 -g3 -Wall -c -fmes sage-length=0 -osqlexample.o sqlexample.c sqlexample.sqc:73:18: warning: character constant too long for its type sqlexample.sqc:73:30: warning: character constant too long for its type sqlexample.sqc:73:42: warning: character constant too long for its type sqlexample.sqc: In function `main': sqlexample.sqc:73: warning: passing arg 1 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:73: warning: passing arg 2 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:73: warning: passing arg 3 of `DbConnect' makes pointer from inte ger without a cast sqlexample.sqc:87: warning: control reaches end of non-void function sqlexample.sqc: In function `TbBasicSelect': sqlexample.sqc:121: warning: unused variable `rc' C:\R20006\cPrograms>gcc -L"C:\Program Files\SQLLIB\include" -L"C:\Program Files\ SQLLIB\lib\db2api.lib" -L"C:\Program Files\SQLLIB\samples\c" -L"C:\Program File s\SQLLIB\bin" -o2006b.exe sqlexample.o sqlexample.o(.text+0xce): In function `main': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefined reference to `_sqlastr t@12' sqlexample.o(.text+0xfd):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefin ed reference to `_sqlacall@20' sqlexample.o(.text+0x10c):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:84: undefi ned reference to `_sqlastop@4' sqlexample.o(.text+0x24a): In function `DbConnect': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undefined reference to `_sqlast rt@12' sqlexample.o(.text+0x271):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x31c):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x34b):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x35a):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:105: undef ined reference to `_sqlastop@4' sqlexample.o(.text+0x380):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlastrt@12' sqlexample.o(.text+0x3a7):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x406):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x435):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x444):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:111: undef ined reference to `_sqlastop@4' sqlexample.o(.text+0x4b1): In function `TbBasicSelect': /cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undefined reference to `_sqlast rt@12' sqlexample.o(.text+0x4d8):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlaaloc@16' sqlexample.o(.text+0x538):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlasetda@24' sqlexample.o(.text+0x567):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlacall@20' sqlexample.o(.text+0x576):/cygdrive/c/R20006/cPrograms/sqlexample.sqc:126: undef ined reference to `_sqlastop@4' collect2: ld returned 1 exit status C:\R20006\cPrograms>rem link -debug -out:sqlexample.exe sqlexample.obj utilemb.o bj db2api.lib C:\R20006\cPrograms>goto exit The system cannot find the batch label specified - exit C:\R20006\cPrograms> Any help will be appreciated Thanks Vinita From amit2030@yahoo.com Fri Aug 20 11:07:00 2004 From: amit2030@yahoo.com (Amit Choudhary) Date: Fri, 20 Aug 2004 11:07:00 -0000 Subject: Function redefined Message-ID: <20040820064908.2664.qmail@web41114.mail.yahoo.com> Hi All, I am writing a program that includes . int atoi(const char *) is declared in that header file. I am defining (not declaring) atoi again in my program and using it. As I know, standrd C library (libc.so) is linked with the program. 1. Doesn't gcc find the definition twice and shouldn't it report the error? What I found was that it uses the first definition found. 2. Was it always like this or sometime during the course of evolution of compilers, it was decided that the first definition would be used? 3. Or, since it is compiled with dynamic library, it is behaving that way? 4. Would compiling it with static C library (libc.a) would give me a "function redefined" error? Any help would be appreciated a lot as I have become involved in a heated discussion regarding this. Regards, Amit _______________________________ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush From stante@gmail.com Fri Aug 20 11:58:00 2004 From: stante@gmail.com (Alexander Stante) Date: Fri, 20 Aug 2004 11:58:00 -0000 Subject: How to add a new target? Message-ID: <1139247004082001025589168c@mail.gmail.com> Hello, I want to add a new target to the gcc. It has a m68k CPU and I have already written the necessary files like a crt0.S and a linker script to correctly compile on that machine. My goal is that I can build a gcc with for example --target=m68k-mymachine-elf and that the gcc then uses my crt0 and linker script (and a spec file which I still have to write). How can I achieve that? Is there some documentation about that? Bye Alex From laalit_seth@hotmail.com Fri Aug 20 13:20:00 2004 From: laalit_seth@hotmail.com (Lalit Seth) Date: Fri, 20 Aug 2004 13:20:00 -0000 Subject: How to use std::sort function. Message-ID: Hi, How to use std::sort function. I have class CStopWeight which holds a overloaded operator < to sort the list in Descending Order. I hve a vector stopWeight which hold the Objects of CStopWeight. I needed to sort them in Descending Order. How can I call the operator < in the std::sort function. I tried std::sort(stopWeight.begin(),stopWeight.end(),CStopWeight< stopWeight) but doesn't work. How can this be done. As I m compiling a code written in VC++ for linux using gcc. Earlier there was a statement which was written but doesn't work. It was std::sort(stopWeight.begin(), &stopWeight[stopWeight.size()]); I don't know what this meant. Some Code Segment below. Many thanks Lalit class CStopWeight { public: int m_originalStop; // original stop //~AC_STOP_SEQ int m_stop; // current T3 stop sequence number //~AC_STOP_SEQ std::string m_order; // order ID //~AC_STOP_SEQ int m_numStacks; // number of stacks in the stop(order) //~AC_STOP_SEQ std::vector m_stackWeight; // weights for each stack in the order. //~AC_STOP_SEQ // cummulativeStackWeight[0] is 1st stack only, cummulativeStackWeight[1] is 1st and 2nd stack etc //~AC_STOP_SEQ CStopWeight(int originalStop, int stop, std::string order, int numStacks) {m_originalStop = originalStop; m_stop = stop; m_order = order; m_numStacks = numStacks; m_stackWeight.clear();}; //~AC_STOP_SEQ ~CStopWeight() {m_stackWeight.clear();}; //~AC_STOP_SEQ // declare the following CStopWeight operators so can use the std::sort function. Note the < operator is set up such that it will sort DESCENDING friend bool operator==(const CStopWeight& stop1, const CStopWeight& stop2); //~AC_STOP_SEQ friend bool operator<(const CStopWeight& stop1, const CStopWeight& stop2); //~AC_STOP_SEQ private: }; ====================================== std::vector stopWeight; // holds stack weights and other info to allow stops weights to be compared std::vector::iterator stopIterator; // iterator // Sort the stops DESC. Heavier stops will be sorted to the front // of , ligher stops to the rear. // Note the "<" operator for CStopWeight was overloaded to sort DESC. // - Assumes stacks sorted within the stop by weight (note: mixed stacks will appear at the front/end of the stop regardless of weight) // - Assumes every stack has the same width/length (and ignores turns). std::sort(stopWeight.begin(), &stopWeight[stopWeight.size()]); //---------------------------------------------------------- // CStopWeight::operator== // Returns true if the axle weights for stop 1 placed before // stop 2 are the same as if stop 1 had been placed after // stop 2 // //---------------------------------------------------------- bool operator==(const CStopWeight& stop1, const CStopWeight& stop2) { int stop1Size; int stop2Size; int i; double axleWeight1; double axleWeight2; stop1Size = stop1.m_stackWeight.size(); stop2Size = stop2.m_stackWeight.size(); // Stop 1 before Stop 2 axleWeight1 = 0.0; for (i = 0; i < stop1Size; i++) { axleWeight1 += (stop1Size + stop2Size - i) * stop1.m_stackWeight.at(i); } for (i = 0; i < stop2Size; i++) { axleWeight1 += (stop2Size - i) * stop2.m_stackWeight.at(i); } // Stop 2 before Stop 1 axleWeight2 = 0.0; for (i = 0; i < stop2Size; i++) { axleWeight2 += (stop1Size + stop2Size - i) * stop2.m_stackWeight.at(i); } for (i = 0; i < stop1Size; i++) { axleWeight2 += (stop1Size - i) * stop1.m_stackWeight.at(i); } return axleWeight1 == axleWeight2; } //---------------------------------------------------------- // CStopWeight::operator< // Returns true if the axle weights for stop 1 placed before // stop 2 would be larger (NOT smaller!). Note sign // reversal because we want to sort DESCENDING not ASCENDING. //---------------------------------------------------------- bool operator<(const CStopWeight& stop1, const CStopWeight& stop2) { int stop1Size; int stop2Size; int i; double axleWeight1; double axleWeight2; stop1Size = stop1.m_stackWeight.size(); stop2Size = stop2.m_stackWeight.size(); // Stop 1 before Stop 2 axleWeight1 = 0.0; for (i = 0; i < stop1Size; i++) { axleWeight1 += (stop1Size + stop2Size - i) * stop1.m_stackWeight.at(i); } for (i = 0; i < stop2Size; i++) { axleWeight1 += (stop2Size - i) * stop2.m_stackWeight.at(i); } // Stop 2 before Stop 1 axleWeight2 = 0.0; for (i = 0; i < stop2Size; i++) { axleWeight2 += (stop1Size + stop2Size - i) * stop2.m_stackWeight.at(i); } for (i = 0; i < stop1Size; i++) { axleWeight2 += (stop1Size - i) * stop1.m_stackWeight.at(i); } return axleWeight1 > axleWeight2; } _________________________________________________________________ Sell what you don??t Need. We help you Ship it out. http://go.msnserver.com/IN/54179.asp Click Here! From eljay@adobe.com Fri Aug 20 15:02:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 20 Aug 2004 15:02:00 -0000 Subject: Function redefined In-Reply-To: <20040820064908.2664.qmail@web41114.mail.yahoo.com> References: <20040820064908.2664.qmail@web41114.mail.yahoo.com> Message-ID: <6.1.2.0.2.20040820065044.01e73440@iplan-mn.corp.adobe.com> Hi Amit, >1. Doesn't gcc find the definition twice and shouldn't it report the error? No. Definitions in your object code supersede definitions in archive libraries and shared object libraries. If not careful, antics and hilarity can ensue. What I found was that it uses the first definition found. >2. Was it always like this or sometime during the course of evolution of compilers, it was decided that the first definition would be used? It's been like that as long as I'm aware. But I've only been programming for 28 years. Maybe in the good old days before I started programming it was different. Or maybe it's different on platforms other than the ones I'm familiar with. >3. Or, since it is compiled with dynamic library, it is behaving that way? Yes, dynamic libraries (SSO) behave that way, although DSO's do not. SSO - static shared object DSO - dynamic shared object You can list out your executable's SSO's using the ldd command. DSO's explicitly use the dlopen and manually match symbols up from the shared object library. You could use a DSO to access the atoi function in the library, even if you have an SSO or executable that has defined a different atoi function. >4. Would compiling it with static C library (libc.a) would give me a "function redefined" error? No. Your object code supersedes both shared object libraries and archive libraries. (There are tricks to make that not happen, but you'd have to take measures and fiddle with some of the compiler/linker options.) HTH, --Eljay From ankitjain1580@yahoo.com Fri Aug 20 21:13:00 2004 From: ankitjain1580@yahoo.com (=?iso-8859-1?q?Ankit=20Jain?=) Date: Fri, 20 Aug 2004 21:13:00 -0000 Subject: gcc+asm Message-ID: <20040820132039.43243.qmail@web52907.mail.yahoo.com> hi i want to know the difference b/w the following instrutions "movq (%1),(%0) \n" "movq %1, %0 \n" basic question is what is bracket doing with the operands. does it have some significance? thanks ankit ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From ER120834@teradata-ncr.com Fri Aug 20 21:46:00 2004 From: ER120834@teradata-ncr.com (Ray, Edmond) Date: Fri, 20 Aug 2004 21:46:00 -0000 Subject: Trying to build on UNIX V.4 Message-ID: <6B90E33D6C66D3119C7D00E029265322160C88AF@susdayte01.daytonoh.ncr.com> I am trying to build gcc on a version of UNIX V.4 called MP-RAS. The build seems to be going fine until what looks like the final link. I get the following error: /usr/gnu/bin/gcc -g -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -DHAVE_CONFIG_H -o Tcollect2 \ collect2.o tlink.o intl.o version.o ../libiberty/libiberty.a ../intl/libintl.a -lld /usr/gnu/bin/ld: Tcollect2: Not enough room for program headers (allocated 5, need 6) /usr/gnu/bin/ld: final link failed: Bad value make[2]: *** [collect2] Error 1 make[2]: Leaving directory `/home/ed/GNU/gcc-3.4.0/gcc' make[1]: *** [stage1_build] Error 2 make[1]: Leaving directory `/home/ed/GNU/gcc-3.4.0/gcc' make: *** [bootstrap] Error 2 Can someone help me PLEASE. Edmond Ray Senior Data Warehouse Consultant Special Programs, NCR Government Systems From Vinita_Sinha@tesseract.com Fri Aug 20 22:07:00 2004 From: Vinita_Sinha@tesseract.com (Sinha, Vinita) Date: Fri, 20 Aug 2004 22:07:00 -0000 Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Message-ID: <92F42ACDF6EDA547BA003A49A68A651E0ED0BD@tessmail.tesseract.com> Hi, I have a embedded sql C program compiled and bound using gcc version 3.3.1 . It goes againat udb/db2 version 8.1 . I am getting the following error when trying to execute the program . Is there something I am missing or is it a known issue on which I can get some help . Exception: STATUS_ACCESS_VIOLATION at eip=610D39A1 eax=00000000 ebx=00000000 ecx=FFFFFFFF edx=FFFFFFFF esi=00000000 edi=FFFFFFFF ebp=0022D708 esp=0022D704 program=C:\R20006\cPrograms\2006l.exe, pid 2088, thread main cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023 Stack trace: Frame Function Args 0022D708 610D39A1 (FFFFFFFF, 0022D7DE, 00401228, 00000001) 0022EE58 610D77FC (0022F208, 6111B310, 00401219, 0022EEA8) 0022EE78 610D6F05 (6111B310, 00401219, 0022EEA4, 0A051000) 0022EE98 610E4837 (00401219, FFFFFFFF, 00000000, 6111B374) 0022EF88 6108DF2F (69636131, 646D696E, 646D696E, 610F3EA0) 0022F058 004010EE (00000001, 0A050190, 0A0500A8, 00000001) 0022F0A8 61005F54 (0022F0C0, FFFFFFFF, 0A016A30, 0A016C44) 0022FF88 6100616B (00000000, 00000000, 00000000, 00000000) End of stack trace This is what I used to compile , bind the program and create the executable . @echo off if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -m32 -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -m32 -L"C:\Program Files\SQLLIB\lib" -L"C:\Program Files\SQLLIB\include" -o"2006l.exe" sqlexample.o utilemb.o "C:\Program Files\SQLLIB\lib\db2api.lib" goto exit Thanks From gbras@anacomp.com Sat Aug 21 04:35:00 2004 From: gbras@anacomp.com (Bras, Gerard) Date: Sat, 21 Aug 2004 04:35:00 -0000 Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Message-ID: <66911C8E1F2DA24EB29DE289297A135E1FC07D@usrd104.corp.anacomp.com> Vinita, You have at least one bug in your program, a wild guess on my part is that it's a bad pointer, probably uninitialized. You need to make friends with the debug utility, there are some very good ones now which will let you work at the source code level. If you have gcc available then you may very well also have gdb. In any case this is the kind of problem that needs to be looked at first hand (the source code) and I'm not sure this is the right group for that. I urge you to find an experienced programmer and beg/plead/bribe him/her to walk you through solving this kind of problem. It's one of those skills that will last you a lifetime. Best of luck, Gerard -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Sinha, Vinita Sent: Friday, August 20, 2004 5:13 PM To: gcc-help@gcc.gnu.org Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Hi, I have a embedded sql C program compiled and bound using gcc version 3.3.1 . It goes againat udb/db2 version 8.1 . I am getting the following error when trying to execute the program . Is there something I am missing or is it a known issue on which I can get some help . Exception: STATUS_ACCESS_VIOLATION at eip=610D39A1 eax=00000000 ebx=00000000 ecx=FFFFFFFF edx=FFFFFFFF esi=00000000 edi=FFFFFFFF ebp=0022D708 esp=0022D704 program=C:\R20006\cPrograms\2006l.exe, pid 2088, thread main cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023 Stack trace: Frame Function Args 0022D708 610D39A1 (FFFFFFFF, 0022D7DE, 00401228, 00000001) 0022EE58 610D77FC (0022F208, 6111B310, 00401219, 0022EEA8) 0022EE78 610D6F05 (6111B310, 00401219, 0022EEA4, 0A051000) 0022EE98 610E4837 (00401219, FFFFFFFF, 00000000, 6111B374) 0022EF88 6108DF2F (69636131, 646D696E, 646D696E, 610F3EA0) 0022F058 004010EE (00000001, 0A050190, 0A0500A8, 00000001) 0022F0A8 61005F54 (0022F0C0, FFFFFFFF, 0A016A30, 0A016C44) 0022FF88 6100616B (00000000, 00000000, 00000000, 00000000) End of stack trace This is what I used to compile , bind the program and create the executable . @echo off if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -m32 -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -m32 -L"C:\Program Files\SQLLIB\lib" -L"C:\Program Files\SQLLIB\include" -o"2006l.exe" sqlexample.o utilemb.o "C:\Program Files\SQLLIB\lib\db2api.lib" goto exit Thanks From Vinita_Sinha@tesseract.com Sat Aug 21 11:44:00 2004 From: Vinita_Sinha@tesseract.com (Sinha, Vinita) Date: Sat, 21 Aug 2004 11:44:00 -0000 Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Message-ID: <92F42ACDF6EDA547BA003A49A68A651E0B2D42@tessmail.tesseract.com> It really is a sample program provided by IBM to connect to DB2 so I am not sure why that should be buggy. I will try another one and then debug . Thanks Vinita -----Original Message----- From: Bras, Gerard [mailto:gbras@anacomp.com] Sent: Friday, August 20, 2004 2:46 PM To: Sinha, Vinita; gcc-help@gcc.gnu.org Subject: RE: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Vinita, You have at least one bug in your program, a wild guess on my part is that it's a bad pointer, probably uninitialized. You need to make friends with the debug utility, there are some very good ones now which will let you work at the source code level. If you have gcc available then you may very well also have gdb. In any case this is the kind of problem that needs to be looked at first hand (the source code) and I'm not sure this is the right group for that. I urge you to find an experienced programmer and beg/plead/bribe him/her to walk you through solving this kind of problem. It's one of those skills that will last you a lifetime. Best of luck, Gerard -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On Behalf Of Sinha, Vinita Sent: Friday, August 20, 2004 5:13 PM To: gcc-help@gcc.gnu.org Subject: STATUS_ACCESS_VIOLATION in a embedded sql c program compiled using gcc Hi, I have a embedded sql C program compiled and bound using gcc version 3.3.1 . It goes againat udb/db2 version 8.1 . I am getting the following error when trying to execute the program . Is there something I am missing or is it a known issue on which I can get some help . Exception: STATUS_ACCESS_VIOLATION at eip=610D39A1 eax=00000000 ebx=00000000 ecx=FFFFFFFF edx=FFFFFFFF esi=00000000 edi=FFFFFFFF ebp=0022D708 esp=0022D704 program=C:\R20006\cPrograms\2006l.exe, pid 2088, thread main cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023 Stack trace: Frame Function Args 0022D708 610D39A1 (FFFFFFFF, 0022D7DE, 00401228, 00000001) 0022EE58 610D77FC (0022F208, 6111B310, 00401219, 0022EEA8) 0022EE78 610D6F05 (6111B310, 00401219, 0022EEA4, 0A051000) 0022EE98 610E4837 (00401219, FFFFFFFF, 00000000, 6111B374) 0022EF88 6108DF2F (69636131, 646D696E, 646D696E, 610F3EA0) 0022F058 004010EE (00000001, 0A050190, 0A0500A8, 00000001) 0022F0A8 61005F54 (0022F0C0, FFFFFFFF, 0A016A30, 0A016C44) 0022FF88 6100616B (00000000, 00000000, 00000000, 00000000) End of stack trace This is what I used to compile , bind the program and create the executable . @echo off if exist "%1.sqx" goto embedded if exist "%1.sqc" goto embedded goto non_embedded :embedded rem Precompile and bind the program. call embprep %1 %2 %3 %4 rem Compile the program. if exist "%1.cxx" goto cpp_emb goto link_embedded :cpp_emb rem Link the program. :link_embedded gcc -m32 -I"C:\Program Files\SQLLIB\include" -I"C:\Program Files\SQLLIB\samples\c" -g3 -Wall -c -fmessage-length=0 -osqlexample.o sqlexample.c gcc -m32 -L"C:\Program Files\SQLLIB\lib" -L"C:\Program Files\SQLLIB\include" -o"2006l.exe" sqlexample.o utilemb.o "C:\Program Files\SQLLIB\lib\db2api.lib" goto exit Thanks From jiayu@huawei.com Sat Aug 21 11:52:00 2004 From: jiayu@huawei.com (jiayu 33576) Date: Sat, 21 Aug 2004 11:52:00 -0000 Subject: Two additional errors of GCC 2.96 Message-ID: <6e9e1201.12016e9e@huawei.com> The problem we meeted last have not solved. The code is so large and I am trying to simplify it. We meeted two additional problems.All the errors took place when we were compiling C or C++ using Tornado 2.2 for MIPS. The compiler is GCC 2.96 suppiled by WindRiver. Please help us! Thanks a lot 1. The compiler can't compare an element of enum and an unsigned short variable Error information: ../../../src/momu/src/mnt/cmnt_int.cpp:3736: Internal compiler error in `copy_to_mode_reg', at explow.c:710 cmnt_int.cpp:3736: if ( LID_OMU != g_uwLogicBoardType ) /* Error occurs here */ { vos_printf("error"); } The related defination: typedef enum { LID_OMU = 0x0100, /*256 MOMU,FOMU*/ ... } VOS_UINT16 g_uwLogicalBoardNo = VOS_NULL_WORD; typedef unsigned short VOS_UINT16; #define VOS_NULL_WORD 0xFFFF 2. The compiler can't assign by structure ../../../src/momu/src/mnt/cmnt_int.cpp:3751: Internal compiler error in `move_by_pieces', at expr.c:1505 cmnt_int.cpp:3751 struct tmp a,b; a.time = b.time; /* Error occurs here */ The related defination: #pragma pack(1) struct tmp { VOS_UINT32 a; SYS_T time; }; #pragma pack(4) name: jiayu email: jiayu@huawei.com ************************************************************** This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! ************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: j33576.vcf Type: text/x-vcard Size: 86 bytes Desc: Card for jiayu 33576 URL: From qbvfd@yahoo.com Sat Aug 21 16:05:00 2004 From: qbvfd@yahoo.com (Milford Pruitt) Date: Sat, 21 Aug 2004 16:05:00 -0000 Subject: Fw: edwina Message-ID: I had received this this morning, did you sign up for this yet? http://www.inetcontact.com/ref44.html You can grab music, like full CD albums, and games & movies. I was able to find at least 66 of my favorite CD's You should get a load of how many movies are in here that'l play in your dvd player - it's crazy. They walk you through the entire process of burning them to CD. I noticed in the movie section over lunch, they have titles for download that are still in theaters - it's fantastic. I'll see you next Friday at the get together. Amalia ----44249399925255834325---- From eljay@adobe.com Sat Aug 21 19:28:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Sat, 21 Aug 2004 19:28:00 -0000 Subject: Two additional errors of GCC 2.96 In-Reply-To: <6e9e1201.12016e9e@huawei.com> References: <6e9e1201.12016e9e@huawei.com> Message-ID: <6.1.2.0.2.20040821064243.01e41978@iplan-mn.corp.adobe.com> Jiayu, I recommend upgrading to the most current version of GCC. Either GCC 3.4.1 (latest and greatest), or GCC 3.3.4 (yesterday's tried and true). There is no "GCC 2.96". It's an unofficial, maverick release of GCC by Red Hat. It's not supported on this forum (although we do give some general advice). Your code snippets are incomplete. Is your enum supposed to be missing the terminating semicolon (and thus typedefing to VOS_UINT16)? If so, have you tried separating out g_uwLogicalBoardNo variable from the typedef? Is your VOS_NULL_WORD define supposed to come AFTER it is being used? Is your typedef of VOS_UINT16 supposed to come AFTER it is being used? For your "compiler can't assign by structure"... Is there a good reason to override the platform recommended packing, which can cause errors such as "Internal compiler error in 'move_by_pieces'"? HTH, --Eljay From jiayu@huawei.com Sun Aug 22 04:50:00 2004 From: jiayu@huawei.com (jiayu 33576) Date: Sun, 22 Aug 2004 04:50:00 -0000 Subject: Two additional errors of GCC 2.96 Message-ID: <1329d1121e.1121e1329d@huawei.com> The Gcc 2.96 is provided by WindRiver with it's tool Tornado, which is GUI tool for vxworks. I don't how the version number 2.96 come from. It's just the result of "gcc -v". I have contact with Wind River. I am not very familiar with gcc. Is it easy to change my gcc to 3.3.4? Does it perform just like the one provided by WindRiver? Thanks a lot! name: jiayu email: jiayu@huawei.com ************************************************************** This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! ************************************************************** ----- Original Message ----- From: Eljay Love-Jensen Date: Saturday, August 21, 2004 7:52 pm Subject: Re: Two additional errors of GCC 2.96 > Jiayu, > > I recommend upgrading to the most current version of GCC. Either > GCC 3.4.1 > (latest and greatest), or GCC 3.3.4 (yesterday's tried and true). > > There is no "GCC 2.96". It's an unofficial, maverick release of > GCC by Red > Hat. It's not supported on this forum (although we do give some > general > advice). > > Your code snippets are incomplete. > > Is your enum supposed to be missing the terminating semicolon (and > thus > typedefing to VOS_UINT16)? If so, have you tried separating out > g_uwLogicalBoardNo variable from the typedef? > > Is your VOS_NULL_WORD define supposed to come AFTER it is being used? > > Is your typedef of VOS_UINT16 supposed to come AFTER it is being used? > > For your "compiler can't assign by structure"... > > Is there a good reason to override the platform recommended > packing, which > can cause errors such as "Internal compiler error in > 'move_by_pieces'"? > HTH, > --Eljay > > -------------- next part -------------- A non-text attachment was scrubbed... Name: j33576.vcf Type: text/x-vcard Size: 86 bytes Desc: Card for jiayu 33576 URL: From squirrel@_HOSTNAME_.headnut.org Sun Aug 22 05:12:00 2004 From: squirrel@_HOSTNAME_.headnut.org (squirrel@_HOSTNAME_.headnut.org) Date: Sun, 22 Aug 2004 05:12:00 -0000 Subject: problem bootstrapping gcc 3.4.1 Message-ID: <20040821192808.GA7150@ivanova.headnut.org> hey, i'm trying to bootstrap gcc 3.4.1 with uclibc for an embedded device toolchain, but i keep getting errors upon the compile. the relevant lines: $ tar xfj gcc-3.4.1.tar.gz $ mkdir build-boot-gcc $ cd build-boot-gcc $ ../gcc-3.4.1/configure --target=i386-linux \ --prefix=/home/squirrel/projects/stb_pbx/toolchain \ --without-headers \ --with-newlib \ --disable-nls \ --enable-languages=c $ make all-gcc /home/squirrel/projects/stb_pbx/build-tools/build-boot-gcc/gcc/xgcc -B/home/squirrel/projects/stb_pbx/build-tools/build-boot-gcc/gcc/ -B/home/squirrel/projects/stb_pbx/tools/i386-linux/bin/ -B/home/squirrel/projects/stb_pbx/tools/i386-linux /lib/ -isystem /home/squirrel/projects/stb_pbx/tools/i386-linux/include -isystem /home/squirrel/projects/stb_pbx/tools/i386-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-3.4.1/gcc -I../../gcc-3.4.1/gcc/. -I../../gcc-3.4.1/gcc/../include -DL_muldi3 -c ../../gcc-3.4.1/gcc/libgcc2.c -o libgcc/./_muldi3.o In file included from ./tm.h:11, from ../../gcc-3.4.1/gcc/libgcc2.c:43: ../../gcc-3.4.1/gcc/config/i386/linux.h:217:20: signal.h: No such file or directory ../../gcc-3.4.1/gcc/config/i386/linux.h:218:26: sys/ucontext.h: No such file or directory make[2]: *** [libgcc/./_muldi3.o] Error 1 any help on fixing this issue is greatly appreciated! please e-mail directly or cc me in the reply as i am not on the gcc-help list. thank you! chris From dynamicppl04@yahoo.com Sun Aug 22 13:35:00 2004 From: dynamicppl04@yahoo.com (dynamic ppl) Date: Sun, 22 Aug 2004 13:35:00 -0000 Subject: asm errors Message-ID: <20040822045047.88064.qmail@web53203.mail.yahoo.com> Hi Folks, Can some one shed some light on this? I am trying to compile a package named tmpi and in one particular file i get this error and the person who wrote the code is unable to help. gcc version : 3.2.2 20030222 Processor : Athlon. __inline__ int cas32(volatile int *addr, int old, int new) { char ret; __asm__ __volatile__(LOCK_PREFIX "cmpxchg %2, %1\n\t" /* swap values if current value is known */ "sete %0" /* read success/fail from EF */ : "=q" (ret), "=m" (ADDR) : "r" (new), "a" (old) : "%eax" ); return (int)ret; } error: ---------- make[3]: [clean] Error 1 (ignored) cc -O -Wall -I. -D__SMP__ -c -o atomic.o atomic.c atomic.c: In function `casp': atomic.c:28: warning: cast from pointer to integer of different size atomic.c:28: warning: cast from pointer to integer of different size atomic.c: In function `cas32': atomic.c:7: can't find a register in class `AREG' while reloading `asm' make: *** [atomic.o] Error 1 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From dynamicppl04@yahoo.com Mon Aug 23 09:44:00 2004 From: dynamicppl04@yahoo.com (dynamic ppl) Date: Mon, 23 Aug 2004 09:44:00 -0000 Subject: Assembly errors : compiling Message-ID: <20040822051233.22864.qmail@web53210.mail.yahoo.com> Hi Folks, Sorry for my earlier mail, which did not have the current fuction that was giving the problem. here it is __inline__ int casp(void * *pval, void * old, void * new) { /** * somehow I have to decide the size of (void *) * during the runtime. */ if (sizeof(void *)==sizeof(int)) return cas32((int*)pval, (int)old, (int)new); else return cas64((long long *)pval, (long long)old, (long long)new); } error : cc -O -Wall -I. -D__SMP__ -c -o atomic.o atomic.c atomic.c: In function `casp': atomic.c:28: warning: cast from pointer to integer of different size atomic.c:28: warning: cast from pointer to integer of different size atomic.c: In function `cas32': atomic.c:7: can't find a register in class `AREG' while reloading `asm' make: *** [atomic.o] Error 1 thank you, with regards Shiva _______________________________ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com From rollos@starband.net Mon Aug 23 11:11:00 2004 From: rollos@starband.net (RolloS) Date: Mon, 23 Aug 2004 11:11:00 -0000 Subject: where to install gcc 3.3? Message-ID: <249D0688-F440-11D8-9301-000393D7297A@starband.net> I have downloaded gcc-3-3 to /Developer/Documentation/DeveloperTools/ on my Powermac G4 running OS X 10.2.8, with Decembe 2002 developer tools. Is that the right place for it? Does it matter what directory it is in? Do I need to do any installation, other than moving it to the right place? --Roland Silver -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 382 bytes Desc: not available URL: From andrea_pretto@yahoo.it Mon Aug 23 13:40:00 2004 From: andrea_pretto@yahoo.it (Andrea Pretto) Date: Mon, 23 Aug 2004 13:40:00 -0000 Subject: Help with specs In-Reply-To: References: Message-ID: <1093254518.792.4.camel@debian-host> In my spec , I have changed my cpp line in this way: *cpp: %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} -D_INCLUDE__STDC_A1_SOURCE That is, I have appended -D_INCLUDE__STDC_A1_SOURCE, and this code #include int main ( void ){ #ifdef _INCLUDE__STDC_A1_SOURCE printf("Yes\n"); #else printf("No\n"); #endif return 0; } print "Yes" string. It seem correct. On Mon, 2004-08-16 at 21:24, DY, JERRY U (SBCSI) wrote: > Here's my config: > > g++ -v > Reading specs from > /usr/local/appl/gcc-3.4.1/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.1/specs > Configured with: ../gcc-3.4.1/configure --prefix=/usr/local/appl/gcc > --with-as=/usr/local/appl/binutils/bin/as --enable-threa > ds=posix > Thread model: posix > gcc version 3.4.1 > > I wanted to change the specs so that -D_INCLUDE__STDC_A1_SOURCE is > defined everytime the precompiler is invoked, so I modify the cpp entry > in the specs file as follows: > > *cpp: > -D_INCLUDE__STDC_A1_SOURCE %{mt|pthread:-D_REENTRANT -D_THREAD_SAFE > -D_POSIX_C_SOURCE=199506L} > > But it doesn't appear to be working. Is there something wrong with my > syntax or am I missing something? Thanks! > > -Jerry From julien.finet@tremplin-utc.net Mon Aug 23 13:43:00 2004 From: julien.finet@tremplin-utc.net (julien.finet@tremplin-utc.net) Date: Mon, 23 Aug 2004 13:43:00 -0000 Subject: How compile for another platform Message-ID: <1093259505.4129d0f1f0af4@mailetu.utc.fr> Hello, I know it is possible to compile for Mac on Linux(or windows), but how? Thanks for your help ! Julien. From betus@visa.com Mon Aug 23 16:48:00 2004 From: betus@visa.com (Betu, Satyanarayana) Date: Mon, 23 Aug 2004 16:48:00 -0000 Subject: sizeof(bool) Message-ID: Hello Sir, we are using g++ 2.95.3 .Currently we are facing problems with data type bool.Programs compiling with this compiler are taking bool size as 4 because of which we are not able to prote this application to another machines.Do u have any patch for this problem? Thanks & Regards Satya VISA - VDPS Development IT Division Basingstoke LONDON +44 1256 89 1541 (O) From hueffner@informatik.uni-tuebingen.de Tue Aug 24 01:41:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Tue, 24 Aug 2004 01:41:00 -0000 Subject: sizeof(bool) In-Reply-To: (Satyanarayana Betu's message of "Mon, 23 Aug 2004 14:39:56 +0100") References: Message-ID: <87brh2ynpq.fsf@informatik.uni-tuebingen.de> "Betu, Satyanarayana" writes: > we are using g++ 2.95.3 .Currently we are facing problems with data > type bool.Programs compiling with this compiler are taking bool size > as 4 because of which we are not able to prote this application to > another machines.Do u have any patch for this problem? The C++ standard allows bool to have size 4, so there is no problem in g++; the problem is in your application. However, you might consider upgrading to a current version of g++, where the size of bool is 1 consistently over all architectures. -- Falk From iainw@nortelnetworks.com Tue Aug 24 05:23:00 2004 From: iainw@nortelnetworks.com (Iain Woolf) Date: Tue, 24 Aug 2004 05:23:00 -0000 Subject: Two additional errors of GCC 2.96 References: <6e9e1201.12016e9e@huawei.com> Message-ID: <412A1FC4.66A6CAA7@americasm01.nt.com> jiayu 33576 wrote: > > The problem we meeted last have not solved. The code is so large and I > am trying to simplify it. We meeted two additional problems.All the > errors took place when we were compiling C or C++ using Tornado 2.2 > for MIPS. The compiler is GCC 2.96 suppiled by WindRiver. Please help > us! Thanks a lot > > 1. The compiler can't compare an element of enum and an unsigned short > variable > Error information: > ../../../src/momu/src/mnt/cmnt_int.cpp:3736: Internal compiler error > in `copy_to_mode_reg', at explow.c:710 > > cmnt_int.cpp:3736: > if ( LID_OMU != g_uwLogicBoardType ) /* Error occurs here */ > { > vos_printf("error"); > } > > The related defination: > typedef enum > { > LID_OMU = 0x0100, /*256 MOMU,FOMU*/ > ... > } > VOS_UINT16 g_uwLogicalBoardNo = VOS_NULL_WORD; > typedef unsigned short VOS_UINT16; > #define VOS_NULL_WORD 0xFFFF You say the error occurs on the line with g_uwLogicBoardType, but you supply a definition for g_uwLogicalBoardNo. I have the same compiler and tried the following sample code. It compiled fine //------------------------------------------------------ #include #define VOS_NULL_WORD 0xFFFF typedef unsigned short VOS_UINT16; VOS_UINT16 g_uwLogicalBoardNo = VOS_NULL_WORD; typedef enum { LID_OMU = 0x0100, /*256 MOMU,FOMU*/ }; void somefn(void) { if ( LID_OMU != g_uwLogicalBoardNo ) /* No error here */ { printf("error"); } } //------------------------------------------------------ > 2. The compiler can't assign by structure > ../../../src/momu/src/mnt/cmnt_int.cpp:3751: Internal compiler error > in `move_by_pieces', at expr.c:1505 I don't see why it would give you an internal compiler error, but gcc2.96 (Windriver's compiler based on GNU's gcc2.95) is more ANSI compliant than the previous version of the Windriver compiler (gcc2.72). One of the restrictions is not being able to assign one structure to another. Presumably this is why you have a function called "move_by_pieces". You didn't provide the definition for SYS_T, but I'm guessing this is a structure itself. Cheers, Iain From LiuM@star-net.cn Tue Aug 24 08:08:00 2004 From: LiuM@star-net.cn (Markle Liu) Date: Tue, 24 Aug 2004 08:08:00 -0000 Subject: how to compiler a cross compiler for MPC8540 on the cygwin? Message-ID: Hi all, I had spent lot of time on building a cross compiler for MPC8540 on the cygwin. and i had try serval combination of gcc, binutilis and gdb, but all failed. my project would running on MPC8540 target without OS, and i need gcc, gdb and insight to develop and debug on the target. thanx ? ?? ?? ???????? ?????????????? ====================================================== Email: Lium@star-net.cn Tel: +86 (591) 83057579 Fax: +86 (591) 83057866 URL: http://www.star-net.cn Addr: ???????618????20#-22#??????? Postcode: 350002 ====================================================== From janvier_anonical@yahoo.com Tue Aug 24 10:47:00 2004 From: janvier_anonical@yahoo.com (=?iso-8859-1?q?Janvier=20D.=20Anonical?=) Date: Tue, 24 Aug 2004 10:47:00 -0000 Subject: Two gcc Installations: conflict in library? Message-ID: <20040824052329.32638.qmail@web52104.mail.yahoo.com> Hello! Currently, my gcc (3.3.3) is installed in /usr. I have installed a new gcc (3.4.1) in /usr/local. Now, whenever I do 'gcc --version' the compiler being used is the new one (3.4.1). My questions is this. Which header files (e.g., stdio.h, iostream, etc.) and libraries (e.g., libstdc++, libgcc, etc.) lib will be used by default? Is it the one in /usr/local or the one in /usr? Thanks! ===== Last night as I lay in bed looking at the stars I thought: 'Where the hell is ceiling?' ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From eljay@adobe.com Tue Aug 24 10:54:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 24 Aug 2004 10:54:00 -0000 Subject: Two gcc Installations: conflict in library? In-Reply-To: <20040824052329.32638.qmail@web52104.mail.yahoo.com> References: <20040824052329.32638.qmail@web52104.mail.yahoo.com> Message-ID: <6.1.2.0.2.20040824030733.01e91178@iplan-mn.corp.adobe.com> Hi Janvier, When you compile, put in the -v switch. g++ -v test.cpp The verbose output will state which header file locations and libraries are being used. HTH, --Eljay From eljay@adobe.com Tue Aug 24 16:27:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 24 Aug 2004 16:27:00 -0000 Subject: g++ and null pointers Message-ID: <6.1.2.0.2.20040824053102.01e9b890@iplan-mn.corp.adobe.com> Hi everyone, GCC 3.3.1 on Cygwin When I compile this test.cpp source... // g++ -Wno-long-long -pedantic -Wall -W -c test.cpp #define NULL __null int main() { void* p; p = 0; p = 0u; p = 0ul; p = 0ull; p = 0l; p = 0ll; p = false; // silly... p = -0; p = -0u; p = -0ul; p = -0ull; p = -0l; p = -0ll; p = -false; // my druthers... p = NULL; return 0; } ...GCC is happy with all of these assignments. Are they all supposed (ISO 14882) to be legit? Some of them surprised me. The negated ones are just for fun. I didn't go completely crazy with the cheese whiz, and put in "!!0" and "+0" and hexadecimal, and octal, and various permutations of the [uUlL]* suffix. Sincerely, --Eljay From hueffner@informatik.uni-tuebingen.de Tue Aug 24 17:18:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Tue, 24 Aug 2004 17:18:00 -0000 Subject: g++ and null pointers In-Reply-To: <6.1.2.0.2.20040824053102.01e9b890@iplan-mn.corp.adobe.com> (Eljay Love-Jensen's message of "Tue, 24 Aug 2004 05:47:46 -0500") References: <6.1.2.0.2.20040824053102.01e9b890@iplan-mn.corp.adobe.com> Message-ID: <87eklwajso.fsf@informatik.uni-tuebingen.de> Eljay Love-Jensen writes: > When I compile this test.cpp source... > > // g++ -Wno-long-long -pedantic -Wall -W -c test.cpp > #define NULL __null > int main() > { > void* p; > p = 0; > p = 0u; > p = 0ul; > p = 0ull; > p = 0l; > p = 0ll; > p = false; > // silly... > p = -0; > p = -0u; > p = -0ul; > p = -0ull; > p = -0l; > p = -0ll; > p = -false; > // my druthers... > p = NULL; > return 0; > } > > ...GCC is happy with all of these assignments. > > Are they all supposed (ISO 14882) to be legit? Some of them surprised me. The standard says that a null pointer constant is "[a]n integer constant expression with the value 0", so these seem all OK. -- Falk From lrtaylor@micron.com Tue Aug 24 18:27:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Tue, 24 Aug 2004 18:27:00 -0000 Subject: Two gcc Installations: conflict in library? Message-ID: <363801FFD7B74240A329CEC3F7FE4CC40309610B@ntxboimbx07.micron.com> Mostly likely, when you compile, the new libraries and headers will get picked up. However, depending on how your LD_LIBRARY_PATH (or ld.so.conf on Linux) is set up, you may not get the right libraries - it will depend on whether /usr/lib is search before /usr/local/lib. I would suspect that /usr/local/lib is searched first, but it just depends on how your system is set up. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Janvier D. Anonical Sent: Monday, August 23, 2004 11:23 PM To: gcc-help@gcc.gnu.org Subject: Two gcc Installations: conflict in library? Hello! Currently, my gcc (3.3.3) is installed in /usr. I have installed a new gcc (3.4.1) in /usr/local. Now, whenever I do 'gcc --version' the compiler being used is the new one (3.4.1). My questions is this. Which header files (e.g., stdio.h, iostream, etc.) and libraries (e.g., libstdc++, libgcc, etc.) lib will be used by default? Is it the one in /usr/local or the one in /usr? Thanks! ===== Last night as I lay in bed looking at the stars I thought: 'Where the hell is ceiling?' ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html From iainw@nortelnetworks.com Wed Aug 25 19:30:00 2004 From: iainw@nortelnetworks.com (Iain Woolf) Date: Wed, 25 Aug 2004 19:30:00 -0000 Subject: *.gperf files in gcc directories? Message-ID: <412B784D.3020704@americasm01.nt.com> Hi all, I see a number of gperf files in the gcc source directory: ./gcc/ch/gperf ./gcc/cp/gxx.gperf ./gcc/c-gperf.h ./gcc/c-parse.gperf ./gcc/java/keyword.gperf ./gcc/objc/objc.gperf And I notice that some header files have been produced by calling gperf on these files with various options. However, the gperf step isn't part of the build, so my question is when should one "re-gperf" the above files, if at all? I'm running into the following error when building a gcc cross compiler on linux: gcc -c -DCROSS_COMPILE -DIN_GCC -DHAIFA -DCPU=PPC860 -DHAVE_CONFIG_H -I. -I../../gcc -I../../gcc/config -I../../gcc/../include ../../gcc/c-lex.c In file included from ../../gcc/c-lex.c:170: c-parse.gperf:89: `VEC_STEP' undeclared here (not in a function) c-parse.gperf:89: initializer element is not constant c-parse.gperf:89: (near initialization for `wordlist[132].token') make[1]: *** [c-lex.o] Error 1 make[1]: Leaving directory `/localdisk/data/tornado2.2-cp1-20040816/host/src/gnu.ppc/linux-build/gcc' make: *** [all-gcc] Error 2 At line 170, c-lex.c includes c-gperf.h which was produced by gperf processing the file c-parse.gperf. Any ideas? Iain From ppercot@free.fr Wed Aug 25 20:45:00 2004 From: ppercot@free.fr (Patrick Percot) Date: Wed, 25 Aug 2004 20:45:00 -0000 Subject: Bug ? in hash_map template Message-ID: <20040824.202719.35012417.ppercot@free.fr> Hi, I made some tests with g++ 3.2.3 and g++ 3.3.1 on GNU/Linux and on cygwin g++ 3.3.1. And I got the same results : when I run this program, when inserting "key20" to "key24" the size of the hash_map does not evolve. When I try to get the results back, "key15" to "key19" all give the result 20. I noticed something when debugging the code, in the function resize, the current size is compared to _M_bucket.size() that allways returns 193. Does someone noticed the same behavior ? #include #include using namespace std; using namespace __gnu_cxx; struct eqstr { bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) == 0; } }; int main() { char str[128]; hash_map, eqstr> h; cout << "hash size = " << h.size() << '\n'; for (int i = 0; i < 31; ++i) { sprintf(str, "key%d", i); h[str] = i; cout << "size = " << h.size() << " str = " << str << '\n'; } for (int i = 0; i < 31; ++i) { sprintf(str, "key%d", i); cout << str << " = " << h[str] << '\n'; } } ?+ PP -- Groupe Morbihannais d'Utilisateurs de Logiciels Libres http://www.tuxbihan.org Identifiant Jabber: pp@amessage.de GPG fingerprint = 1A4F E154 3D2C A20E E4CA A543 7951 C5C2 E44A A0B5 Patrick Percot. From j-watson@airvananet.com Wed Aug 25 22:06:00 2004 From: j-watson@airvananet.com (Jon Watson) Date: Wed, 25 Aug 2004 22:06:00 -0000 Subject: Need help to build GCC 3.4.1 for for powerpc-eabi target Message-ID: <41B9D8A6CE9E0A4583291742EECF3CCB03CA5E37@mail.wirelessworld.airvananet.com> Hi - I'm trying to build a GCC 3.4.1 crosscompiler hosted on a Win2K PC (building under Cygwin) with a powerpc-eabi target (need to support PPC750, PPC74xx, MPC82xx, & MPC85xx). When I looked on the GCC 3.4 project web site it didn't appear that anyone else has reported building the powerpc-eabi. I've built the bin-utils (2.14) for powerpc-eabi and they appear to be working. When I build GCC I get an error building genmodes.o. The error from xgcc appears to be that it can't find stdio.h and several other headers that are included by ...\gcc-3.4.1\gcc\system.h. What isn't clear to me is which version of stdio.h *should* be used. I tried editing the makefile to use the headers in /usr/local, but that caused linker errors down the line. I also found a couple of copies of stdio.h in the source tree of the distribution I downloaded from gcc.gnu.org but I can't find one in any of the places the compiler appears to be searching for. Any ideas about what I should do next? Is there a step I'm missing? Below is the output of the make log that I get when build... Thanks in advance, Jon Watson j-watson@airvananet.com $ make bootstrap make[1]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/libiberty' make[2]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/libiberty/testsuite ' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/libiberty/testsuite' make[1]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/libiberty' make[1]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/intl' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/intl' make[1]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/zlib' : make ; exec true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=-O2 -g -O2" "INSTALL=/usr/bin/insta ll -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/insta ll -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCF LAGS_FOR_TARGET=-O2 -g -O2" "MAKE=make" "MAKEINFO=/cygdrive/d/gcc/gcc-3.4.1/miss ing makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin /sh" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/cygdrive/c/ gnutools/gcc-3.4.1" "infodir=/cygdrive/c/gnutools/gcc-3.4.1/info" "libdir=/cygdr ive/c/gnutools/gcc-3.4.1/lib" "prefix=/cygdrive/c/gnutools/gcc-3.4.1" "tooldir=/ cygdrive/c/gnutools/gcc-3.4.1/powerpc-eabi" "AR=ar" "AS=as" "CC=gcc" "CXX=c++" " LD=/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld.ex e" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi -do make[1]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/zlib' Bootstrapping the compiler make[1]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/gcc' make CC=" stage1/xgcc.exe -Bstage1/ -B/cygdrive/c/gnutools/gcc-3.4.1/powerpc-eab i/bin/" CC_FOR_BUILD=" stage1/xgcc.exe -Bstage1/ -B/cygdrive/c/gnutools/gcc-3.4. 1/powerpc-eabi/bin/" \ STAGE_PREFIX=stage1/ \ ADAFLAGS="" CFLAGS="-g -O2" LDFLAGS="" WARN_CFLAGS="\$(GCC_WARN_CFLAGS) " STRICT_WARN="-pedantic -Wno-long-long -Wold-style-definition " libdir=/cygdriv e/c/gnutools/gcc-3.4.1/lib LANGUAGES="c gcov.exe gcov-dump.exe c++ f77 java objc " MAKEINFO="/cygdrive/d/gcc/gcc-3.4.1/missing makeinfo --split-size=5000000" MAK EINFOFLAGS="--no-split" MAKEOVERRIDES= OUTPUT_OPTION="-o \$@" \ CFLAGS="-g -O2" WERROR="" make[2]: Entering directory `/cygdrive/d/gcc/gcc-3.4.1/build/gcc' TARGET_CPU_DEFAULT="" \ HEADERS="auto-host.h ansidecl.h config/i386/xm-cygwin.h" DEFINES="" \ /bin/sh ../../gcc/mkconfig.sh config.h config.h is unchanged TARGET_CPU_DEFAULT="" \ HEADERS="config/rs6000/rs6000.h config/dbxelf.h config/elfos.h config/svr4.h con fig/freebsd-spec.h config/rs6000/sysv4.h config/rs6000/eabi.h defaults.h" DEFINE S="" \ /bin/sh ../../gcc/mkconfig.sh tm.h TARGET_CPU_DEFAULT="" \ HEADERS="auto-host.h ansidecl.h config/i386/xm-cygwin.h" DEFINES="" \ /bin/sh ../../gcc/mkconfig.sh bconfig.h bconfig.h is unchanged stage1/xgcc.exe -Bstage1/ -B/cygdrive/c/gnutools/gcc-3.4.1/powerpc-eabi/bin/ -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wold-style-definition -DHAVE_ CONFIG_H -DGENERATOR_FILE -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../in clude ../../gcc/genmodes.c -o genmodes.o In file included from ../../gcc/genmodes.c:23: ../../gcc/system.h:42:19: stdio.h: No such file or directory ../../gcc/system.h:109:23: sys/types.h: No such file or directory ../../gcc/system.h:111:19: errno.h: No such file or directory ../../gcc/system.h:122:21: string.h: No such file or directory ../../gcc/system.h:123:22: strings.h: No such file or directory ../../gcc/system.h:135:21: stdlib.h: No such file or directory ../../gcc/system.h:158:21: unistd.h: No such file or directory ../../gcc/system.h:162:24: sys/param.h: No such file or directory ../../gcc/system.h:201:23: sys/time.h: No such file or directory ../../gcc/system.h:202:19: time.h: No such file or directory ../../gcc/system.h:214:20: fcntl.h: No such file or directory ../../gcc/system.h:252:22: sys/wait.h: No such file or directory ../../gcc/system.h:319:20: malloc.h: No such file or directory ../../gcc/system.h:383:23: sys/stat.h: No such file or directory ../../gcc/genmodes.c: In function `new_mode': ../../gcc/genmodes.c:159: warning: implicit declaration of function `memcpy' ../../gcc/genmodes.c: In function `eq_mode': ../../gcc/genmodes.c:188: warning: implicit declaration of function `strcmp' ../../gcc/genmodes.c: In function `complete_mode': ../../gcc/genmodes.c:367: warning: implicit declaration of function `abort' ../../gcc/genmodes.c: In function `make_complex_modes': ../../gcc/genmodes.c:419: warning: implicit declaration of function `strlen' ../../gcc/genmodes.c:432: warning: implicit declaration of function `strncpy' ../../gcc/genmodes.c:433: warning: implicit declaration of function `strchr' ../../gcc/genmodes.c:444: warning: implicit declaration of function `snprintf' ../../gcc/genmodes.c: In function `calc_wider_mode': ../../gcc/genmodes.c:736: warning: implicit declaration of function `qsort' ../../gcc/genmodes.c: In function `emit_insn_modes_h': ../../gcc/genmodes.c:771: warning: implicit declaration of function `printf' ../../gcc/genmodes.c:775: warning: implicit declaration of function `puts' ../../gcc/genmodes.c: In function `main': ../../gcc/genmodes.c:1200: error: `free' undeclared (first use in this function) ../../gcc/genmodes.c:1200: error: (Each undeclared identifier is reported only o nce ../../gcc/genmodes.c:1200: error: for each function it appears in.) ../../gcc/genmodes.c:1217: warning: implicit declaration of function `fflush' ../../gcc/genmodes.c:1217: error: `stdout' undeclared (first use in this functio n) ../../gcc/genmodes.c:1217: warning: implicit declaration of function `fclose' make[2]: *** [genmodes.o] Error 1 make[2]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/gcc' make[1]: *** [stage2_build] Error 2 make[1]: Leaving directory `/cygdrive/d/gcc/gcc-3.4.1/build/gcc' make: *** [bootstrap] Error 2 From TPCnospam@mklab.ph.rhul.ac.uk Wed Aug 25 23:47:00 2004 From: TPCnospam@mklab.ph.rhul.ac.uk (TPCnospam@mklab.ph.rhul.ac.uk) Date: Wed, 25 Aug 2004 23:47:00 -0000 Subject: subl $, %esp related segfault Message-ID: <200408252045.i7PKjcEG025776@mklab.ph.rhul.ac.uk> Dear All, I am getting segfaults in a FORTRAN program compiled with g95 under Linux/i386 but the problem is not specific to g95. I can simulate it with g77 which similarly uses gcc's assembler generation routines. It is just that I have some quite large subroutines (originally Fortran 77) which been trivially converted to use a derived datatype under g95 which has the effect of substantially increasing the code size and memory usage -- to the extent that the problem I'm describing occurs. The problem subroutines are part of a set of similar, numerically intensive ones, most of which work fine. It is just the few biggest ones which have this problem. Here is some assembler O/P from g95 for a problem subroutine. .type fo7dma0dmc0_, @function fo7dma0dmc0_: .LFB93: .loc 1 1 0 pushl %ebp .LCFI315: movl %esp, %ebp .LCFI316: pushl %edi .LCFI317: pushl %esi .LCFI318: pushl %ebx .LCFI319: subl $9389456, %esp .LCFI320: .loc 2 20 0 .LBB47: pushl $3 pushl $.LC0 etc. etc. Here is my analysis: The 'subl $9389456, %esp' pulls the stack pointer down by that large number. When the 'pushl $3' tries to execute it overflows the stack and gets a segfault. My FORTRAN code uses static allocation. The thing I don't understand is; what precisely is the subl's purpose? Is there a way to reduce its size? eg. a compiler option. I'm reluctant to try splitting the subroutine up into two smaller ones. Any other ideas? Thanks Tom. Ps. Where can I find a description of GNU/Linux procedure calling standard? -- Tom Crane, Dept. Physics, Royal Holloway, University of London, Egham Hill, Egham, Surrey, TW20 0EX, England. Email: T.Crane@rhul.ac.uk Fax: +44 (0) 1784 472794 From netbsd@wolfnode.de Thu Aug 26 06:46:00 2004 From: netbsd@wolfnode.de (Florian Stoehr) Date: Thu, 26 Aug 2004 06:46:00 -0000 Subject: CPP preprocessor: #define-splitting? Message-ID: Hi, I'm developing a gcc-compatible preprocessor for a compiler project. While doing this, I discovered something strange. In preprocessor documentation: /\ * */ # /* */ defi\ ne FO\ O 10\ 20 will expand to "#define FOO 1020". It does. But: # /* */ define TEST "foo" --> #define TEST "foo" Replacing the "#" by an "X" will produce with gcc -E: X define TEST "foo" _BUT_: # define TEST "foo" --> TEST doen't get defined. The problem is: Why does it recognize the "#" and "define" splitted by a multi-line comment as "#define"? Is this the correct behaviour? Thanks for your help Florian From eljay@adobe.com Thu Aug 26 07:13:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 26 Aug 2004 07:13:00 -0000 Subject: CPP preprocessor: #define-splitting? In-Reply-To: References: Message-ID: <6.1.2.0.2.20040825184620.01e4f9d8@iplan-mn.corp.adobe.com> Hi Florian, The # is a preprocessor directive. The X is not a preprocessor directive. The rules for parsing preprocessor directives is different form the rules for parsing non-preprocessor directives. (The state machine is in a different state.) HTH, --Eljay From arno.wilhelm@profile.co.at Thu Aug 26 07:28:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Thu, 26 Aug 2004 07:28:00 -0000 Subject: subl $, %esp related segfault In-Reply-To: <200408252045.i7PKjcEG025776@mklab.ph.rhul.ac.uk> References: <200408252045.i7PKjcEG025776@mklab.ph.rhul.ac.uk> Message-ID: <1093502786.12104.2.camel@dione.profile.co.at> > Ps. Where can I find a description of GNU/Linux procedure calling > standard? Here is a lot of documentation: http://linuxassembly.org/resources.html#docs http://linuxassembly.org/intro/hello.html#AEN55 Arno From achordia@ptc.com Thu Aug 26 09:54:00 2004 From: achordia@ptc.com (Amit Chordia) Date: Thu, 26 Aug 2004 09:54:00 -0000 Subject: [Fwd: GCC Specific warning to error] Message-ID: <412D8D57.7020204@ptc.com> -------------- next part -------------- An embedded message was scrubbed... From: Amit Chordia Subject: GCC Specific warning to error Date: Thu, 26 Aug 2004 12:31:06 +0530 Size: 617 URL: From netbsd@wolfnode.de Thu Aug 26 12:10:00 2004 From: netbsd@wolfnode.de (Florian Stoehr) Date: Thu, 26 Aug 2004 12:10:00 -0000 Subject: CPP preprocessor: #define-splitting? In-Reply-To: <6.1.2.0.2.20040825184620.01e4f9d8@iplan-mn.corp.adobe.com> References: <6.1.2.0.2.20040825184620.01e4f9d8@iplan-mn.corp.adobe.com> Message-ID: On Wed, 25 Aug 2004, Eljay Love-Jensen wrote: > Hi Florian, > > The # is a preprocessor directive. > > The X is not a preprocessor directive. > > The rules for parsing preprocessor directives is different form the rules > for parsing non-preprocessor directives. (The state machine is in a > different state.) > > HTH, > --Eljay > > Hi, thanks for the reply. But there seems to happen something strange BEFORE the preprocessing itself (in comment remove stage?). Why am I allowed to do a... # /* */ define and a # define not? I thought the stage where it strips out comments comes before the "main" preprocessor where it scans for #-directives. so why is the # define allowed to be split on multiple lines WITHOUT a backslash-newline? afaik, any comment gets replaced by a single " " and every newline inside the comment gets added AFTER the comment. so the # /* */ define should become a # define after the comment removing stage - but this does not work see above. (just confused wheter it does something special with comments "inside" a #-directive) -Florian From vonloesch@gmail.com Thu Aug 26 14:16:00 2004 From: vonloesch@gmail.com (Boris von Loesch) Date: Thu, 26 Aug 2004 14:16:00 -0000 Subject: Problem with implicit conversion (GCC 3.4.1) Message-ID: <41a2e2dc04082602547057f04c@mail.gmail.com> Hello, I have written a program that compiles just fine with GCC 3.3. With GCC 3.4.1 it results in this error: g++ -O0 -g3 -Wall -c -oTestp.o ../Testp.c ../Testp.c: In function `int main()': ../Testp.c:26: error: no match for 'operator<=' in 't <= 2.0e+0' Please help me, I have no idea where the problem is. Here is the code: template class BasisF; template inline bool operator<=(const BasisF &a, const BasisF &b){return a.x <= b.x;} template class BasisF{ public: T x; BasisF(const T &_x = T()): x(_x){} BasisF(const BasisF &_b): x(_b.x){} ~BasisF(){} BasisF& operator= (const T &_x){ x(_x); return *this; } friend bool operator<=<>(const BasisF &a, const BasisF &b); }; #define min(a,b) ((a) <= (b) ? (a) : (b)) int main(){ BasisF t(1); if (min(t,2.0)<=0) return 1; return 0; } Regards, Boris From suresh@comodogroup.com Thu Aug 26 14:22:00 2004 From: suresh@comodogroup.com (L.Suresh) Date: Thu, 26 Aug 2004 14:22:00 -0000 Subject: std::string, std::ostringstream behaves unpredictably in multithreaded environment. Message-ID: <1093522170.5336.22.camel@Ironwing> Hi, I'm using pthreads on Fedora Core 1. I have compiled my entire project with -D_REENTRANT -D_MULTI_THREADED I get Segmentation faults for naive code that uses std::string's operator+, std::ostringstream's operator<< as a local variable in stack. std::string Formatter::format(const LogRecord& record) const { std::ostringstream ost; ost << record.getTime() << " " << record.getMessage(); //<--Crashes return ost.str(); } Do i have to do anything extra in order for my program to behave predictably in multi-threaded environment? Regards, L.Suresh. From eljay@adobe.com Thu Aug 26 15:23:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 26 Aug 2004 15:23:00 -0000 Subject: searching the GCC manual (tip of the day) Message-ID: <6.1.2.0.2.20040826091117.01e4f4d8@iplan-mn.corp.adobe.com> Tip of they day.. Put this into a script where you've unpacked your GCC documentation from the tarball. --------------------------- echo "" >tmp.htm echo "

Your results..." >>tmp.htm grep -l -i "$1" *.html | sed 's@\(.*\)@
\1@' >> tmp.htm echo "" >tmp.htm --------------------------- This will create a (more-or-less well-formed) html page with your search results. Since the GCC documentation pages end in extension ".html", this page should be isolated from the real documentation. Then you can use your browser to load up tmp.htm and view each of the resulting pages. Enjoy, --Eljay From eljay@adobe.com Thu Aug 26 15:56:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 26 Aug 2004 15:56:00 -0000 Subject: searching the GCC manual (tip of the day) In-Reply-To: <6.1.2.0.2.20040826091117.01e4f4d8@iplan-mn.corp.adobe.com> References: <6.1.2.0.2.20040826091117.01e4f4d8@iplan-mn.corp.adobe.com> Message-ID: <6.1.2.0.2.20040826092105.01e6c8e0@iplan-mn.corp.adobe.com> Cut and paste error missed a ">" where a ">>" was needed, fixed below... --------------------------- echo "" >tmp.htm echo "

Your results..." >>tmp.htm grep -l -i "$1" *.html | sed 's@\(.*\)@
\1@' >> tmp.htm echo "" >>tmp.htm --------------------------- --Eljay From purnendu@gmail.com Thu Aug 26 15:59:00 2004 From: purnendu@gmail.com (Purnendu/Gmail) Date: Thu, 26 Aug 2004 15:59:00 -0000 Subject: allignment in structures Message-ID: <4ca029ac04082608234d62cfda@mail.gmail.com> #pragma pack(2) struct abc { char a; char b; char c; }; A sizeof( struct abc) gives 3, shouldnot i expect it to be 4? any pointers??? i am using " gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)" -purnendu From steve@millersnet.net Thu Aug 26 16:05:00 2004 From: steve@millersnet.net (steve@millersnet.net) Date: Thu, 26 Aug 2004 16:05:00 -0000 Subject: how to combine gcc and binutils source into one tree Message-ID: <1803.192.168.0.4.1093535979.squirrel@nautilus.tsunami.us> they have common directories libiberty,include,texinfo,config, etc.... what is the best way to merge them? thanks in advance Steven From eljay@adobe.com Thu Aug 26 16:19:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Thu, 26 Aug 2004 16:19:00 -0000 Subject: allignment in structures In-Reply-To: <4ca029ac04082608234d62cfda@mail.gmail.com> References: <4ca029ac04082608234d62cfda@mail.gmail.com> Message-ID: <6.1.2.0.2.20040826105923.01fbd390@iplan-mn.corp.adobe.com> Hi Purnendu, >A sizeof( struct abc) gives 3, shouldnot i expect it to be 4? No, it should be 3 in this case. The char data type has an alignment of 1. #pragma pack(2) does not increase alignment requirements, it only decreases them. >any pointers??? Use GCC __attribute__ with aligned and pack to affect alignment and/or packing, don't use #pragma pack. // C++ example. #include #include struct Foo { char a __attribute__((aligned(2))); char b __attribute__((aligned(2))); long c __attribute__((packed)); char d; char e; }; int main() { printf("Foo.a %d\n", offsetof(Foo, a)); printf("Foo.b %d\n", offsetof(Foo, b)); printf("Foo.c %d\n", offsetof(Foo, c)); printf("Foo.d %d\n", offsetof(Foo, d)); printf("Foo.e %d\n", offsetof(Foo, e)); } Note: the aligned attribute has certain restrictions, depending on platform. See the online documentation. Often, alignment and packing are used to mimic a canonical data structure, which populates the structure using read or fread. I strongly discourage that practice, and encourage having a helper read routine that populates the structure field-by-field from the byte-by-byte data source. Likewise, the inverse for the write routines. HTH, --Eljay From manoj_mp@hotmail.com Thu Aug 26 16:27:00 2004 From: manoj_mp@hotmail.com (Manoj Pillai) Date: Thu, 26 Aug 2004 16:27:00 -0000 Subject: GCC Project Help ! Message-ID: Hello Sir , I am Manoj Pillai , i am doing my Computer Engg. as a part of Final Year Project we hv been given a topic "Reverse Enggineering OF GCC Front End " And the as a inital part of The project , we hv been asked to analysis , a file called expr.c which converts the parse tree to RTL . It wouild be my pleasure , if u let me know abt how to go about it. And is there any site which could let em know abt the Data structure used in GCC . It would be also nice, if u could let me know any GCC contributor would be interested in Helping us or any other forum where we could het assist from . Thanks. Yours Truly Manoj Pillai . Have a Nice Day . _________________________________________________________________ Marriage by choice.... http://www.shaadi.com/ptnr.php?ptnr=hmltag Log onto Shaadi.com. From dk@artimi.com Thu Aug 26 17:27:00 2004 From: dk@artimi.com (Dave Korn) Date: Thu, 26 Aug 2004 17:27:00 -0000 Subject: GCC Project Help ! In-Reply-To: Message-ID: > -----Original Message----- > From: gcc-owner On Behalf Of Manoj Pillai > Sent: 26 August 2004 17:05 > To: gcc-help; gcc > Subject: GCC Project Help ! > > > Hello Sir , > > I am Manoj Pillai , i am doing my Computer Engg. as a part > of Final Year > Project we hv been given a topic > > "Reverse Enggineering OF GCC Front End " Hey, that sounds fairly easy, given that the source code is publicly available! > And the as a inital part of The project , we hv been asked to > analysis , a > file called expr.c which converts the parse tree to RTL . > > It wouild be my pleasure , if u let me know abt how to go > about it. How to analyse a source file? Isn't that what the course you've been doing was supposed to teach you? Are you asking us to summarize all the lessons and lectures that you have been taught during your course? Or just to do your homework for you? > And is > there any site which could let em know abt the Data structure > used in GCC . You want to see the compiler internals documentation: http://gcc.gnu.org/onlinedocs/gccint/ That's the best explanation you'll get of the overall structure and operations of the compiler. The rest you have to understand by studying the source code and seeing how it works, what functions there are, looking at RTL dumps, running gcc under a debugger to see where the control flow goes and what it does when it's there, etc. etc. There are a lot of comments in the source code; they're not all entirely up-to-date or accurate, but most of the data structures in the source code have good comments to explain what they are for and what all the data members mean. > It would be also nice, if u could let me know any GCC > contributor would be > interested in Helping us or any other forum where we could > het assist from . You're on a university course. If you need some training in software engineering techniques, why not ask your tutors? They are supposed to be there to help you..... cheers, DaveK -- Can't think of a witty .sigline today.... From lrtaylor@micron.com Thu Aug 26 17:46:00 2004 From: lrtaylor@micron.com (lrtaylor@micron.com) Date: Thu, 26 Aug 2004 17:46:00 -0000 Subject: Problem with implicit conversion (GCC 3.4.1) Message-ID: <363801FFD7B74240A329CEC3F7FE4CC403096133@ntxboimbx07.micron.com> Well, you've declared a <= operator that can compare to BasisF objects, but you're trying to compare a BasisF object with a double, which you haven't created an operator for: min(t,2.0) -> ((t) <= (2.0) ? (t) > (2.0)) So, in your min macro, you are trying to compare the object t with the double 2.0. You don't have an operator for that. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Boris von Loesch Sent: Thursday, August 26, 2004 3:55 AM To: gcc-help@gcc.gnu.org Subject: Problem with implicit conversion (GCC 3.4.1) Hello, I have written a program that compiles just fine with GCC 3.3. With GCC 3.4.1 it results in this error: g++ -O0 -g3 -Wall -c -oTestp.o ../Testp.c ../Testp.c: In function `int main()': ../Testp.c:26: error: no match for 'operator<=' in 't <= 2.0e+0' Please help me, I have no idea where the problem is. Here is the code: template class BasisF; template inline bool operator<=(const BasisF &a, const BasisF &b){return a.x <= b.x;} template class BasisF{ public: T x; BasisF(const T &_x = T()): x(_x){} BasisF(const BasisF &_b): x(_b.x){} ~BasisF(){} BasisF& operator= (const T &_x){ x(_x); return *this; } friend bool operator<=<>(const BasisF &a, const BasisF &b); }; #define min(a,b) ((a) <= (b) ? (a) : (b)) int main(){ BasisF t(1); if (min(t,2.0)<=0) return 1; return 0; } Regards, Boris From suresh_lakshmana@hotmail.com Thu Aug 26 19:54:00 2004 From: suresh_lakshmana@hotmail.com (Suresh Lakshmanan) Date: Thu, 26 Aug 2004 19:54:00 -0000 Subject: Problem with implicit conversion (GCC 3.4.1) Message-ID: Try the code below. You could use std::min template in STL, so that you can force conversion to the template parameter. template class BasisF { T x; public: BasisF(const T &_x = T()): x(_x) {} BasisF(const BasisF &_b): x(_b.x) {} ~BasisF() {} BasisF& operator= (const T &_x){ x(_x); return *this; } friend bool operator<=(const BasisF &a, const BasisF &b) { return a.x <= b.x; } }; #define min(a,b) ((a) <= (b) ? (a) : (b)) int main(){ BasisF t(1); if (min(t, 2.0)<= 0) { return 1; } return 0; } Thanks, L.Suresh. _________________________________________________________________ Sell what you don??t Need.We help you Ship it out. http://go.msnserver.com/IN/54179.asp Click Here! From lars.segerlund@comsys.se Thu Aug 26 21:34:00 2004 From: lars.segerlund@comsys.se (Lars Segerlund) Date: Thu, 26 Aug 2004 21:34:00 -0000 Subject: GCC Project Help ! In-Reply-To: References: Message-ID: <20040826194612.14d7fa8b@zeta.comsys.se> It's easy. You first download gcc from cvs and build. Then you get the gcc summit procedings for the last five years or so. Now you only have to look into the code. So three simple steps and you're there. / good luck, Lars Segerlund. On Thu, 26 Aug 2004 16:05:16 +0000 "Manoj Pillai" wrote: > > Hello Sir , > > I am Manoj Pillai , i am doing my Computer Engg. as a part of Final Year > Project we hv been given a topic > > "Reverse Enggineering OF GCC Front End " > > And the as a inital part of The project , we hv been asked to analysis , a > file called expr.c which converts the parse tree to RTL . > > It wouild be my pleasure , if u let me know abt how to go about it. And is > there any site which could let em know abt the Data structure used in GCC . > > It would be also nice, if u could let me know any GCC contributor would be > interested in Helping us or any other forum where we could het assist from . > > Thanks. > > Yours Truly > > Manoj Pillai . > > Have a Nice Day . > > _________________________________________________________________ > Marriage by choice.... http://www.shaadi.com/ptnr.php?ptnr=hmltag Log onto > Shaadi.com. > From vonloesch@gmail.com Thu Aug 26 22:17:00 2004 From: vonloesch@gmail.com (Boris von Loesch) Date: Thu, 26 Aug 2004 22:17:00 -0000 Subject: Problem with implicit conversion (GCC 3.4.1) In-Reply-To: References: Message-ID: <41a2e2dc04082612547497f4c8@mail.gmail.com> Thanks for your replay. This code works, but why does your code work and my not? Why does it not compile with gcc 3.4.1 but with gcc 3.3? Boris On Thu, 26 Aug 2004 17:27:36 +0000, Suresh Lakshmanan wrote: > Try the code below. You could use std::min template in STL, so that you can > force conversion > to the template parameter. > > template class BasisF { > T x; > public: > > BasisF(const T &_x = T()): x(_x) {} > BasisF(const BasisF &_b): x(_b.x) {} > ~BasisF() {} > > BasisF& operator= (const T &_x){ > x(_x); > return *this; > } > > friend bool operator<=(const BasisF &a, const BasisF &b) { > return a.x <= b.x; > } > }; > > #define min(a,b) ((a) <= (b) ? (a) : (b)) > > int main(){ > BasisF t(1); > if (min(t, 2.0)<= 0) { > return 1; > } > > return 0; > } From pauasc@earthlink.net Fri Aug 27 05:18:00 2004 From: pauasc@earthlink.net (Paul Arbour) Date: Fri, 27 Aug 2004 05:18:00 -0000 Subject: WANTED OKUMA LU-15 Message-ID: <091701c48b8f$90e88c00$6401a8c0@office> WANTED: Okuma LU 15 CNC LATHE -- will pay cash, actually -- interested in all Okumas--please email sales@westecmachinery.com Best Regards, BarbaraMark sales@westecmachinery.com From Mark.Zvilius@fluke.com Fri Aug 27 06:58:00 2004 From: Mark.Zvilius@fluke.com (Zvilius, Mark) Date: Fri, 27 Aug 2004 06:58:00 -0000 Subject: asm constraints Message-ID: <732BE51FE9901143AE04411A11CC46560484AAB5@evtexc02.tc.fluke.com> For a PowerPC architecture I'm using the following asm statement in C source to read a time base register: unsigned int tbl; __asm__("mftbl %0" : "=r" (tbl)); The code this generates is: mftb r0 mr r9,r0 stw r9,0x18(r31) I'm wondering why it's wasting a register. Am I specifying the constraint incorrectly? Mark Z. From zack@codesourcery.com Fri Aug 27 07:08:00 2004 From: zack@codesourcery.com (Zack Weinberg) Date: Fri, 27 Aug 2004 07:08:00 -0000 Subject: compiles under g++ but not gcc In-Reply-To: <1093582054.1431.7.camel@darkstar.org> (sol@avalon.pascal-central.com's message of "Fri, 27 Aug 2004 00:47:34 -0400") References: <1093582054.1431.7.camel@darkstar.org> Message-ID: <87n00h9n0h.fsf@codesourcery.com> sol writes: > Hello, not sure I'm posting this to the right list, but I couldn't seem > to find any others. This question is appropriate for gcc-help@gcc.gnu.org, or for a general learning-to-program group, but not for gcc@gcc.gnu.org. gcc@gcc.gnu.org is for discussion of development _of_, not _with_, gcc. I will answer this question anyway, but please do not post further such questions. > I've noticed a problem compiling under g++ and gcc. a program I am > working on compiles fine under g++, but gives a number of errors > with gcc. I have defined a simple structure in a header file, > included this header in the main file that uses this structure, and > when I compile under gcc, I get errors related to all variables of > that structure type (the one defined in the header); it does not > recognize the structure type that was defined in the header. When > compiling under g++, there is no problem at all. Since you did not show us any code, I can only guess what your problem is. You have probably run afoul of a well-known difference between C and C++. In C++, if you write struct S { int whatever; }; you may then write S variable; In C by contrast you must write struct S variable; unless you use a typedef to define 'S' as equivalent to 'struct S'. zw From learning_c@hotmail.com Fri Aug 27 09:16:00 2004 From: learning_c@hotmail.com (learning c++) Date: Fri, 27 Aug 2004 09:16:00 -0000 Subject: template-id does not match any template declaration Message-ID: Hi, I am a novice for C++, and I compiled a program with C++ and there are an error, Pleaes help me. Thanks, #include template class pair { T value1, value2; public: pair (T first, T second) {value1=first; value2=second;} T module () {return 0;} }; template <> class pair { int value1, value2; public: pair (int first, int second) {value1=first; value2=second;} int module (); }; template <> int pair::module() { return value1%value2; } int main () { pair myints (100,75); pair myfloats (100.0,75.0); std::cout << myints.module() << '\n'; std::cout << myfloats.module() << '\n'; return 0; } Error: templatemodule1.cpp:22: error: template-id `module<>' for `int pair::module()' does not match any template declaration templatemodule1.cpp:22: error: syntax error before `{' token _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From Daniel_Yu@Jabil.com Fri Aug 27 11:13:00 2004 From: Daniel_Yu@Jabil.com (Daniel Yu) Date: Fri, 27 Aug 2004 11:13:00 -0000 Subject: The question for compiling gcc-3.4.1 for xscale target Message-ID: <2A5969FA1F2BAE48BA505A2BD83BD9650217C062@shamsg10.corp.jabil.org> Hello everyone: I want to compile the gcc-3.4.1 for xscale-target linux. My OS is redhat 9.0, gcc is 3.2.2. After i download the package from gcc.gnu.org, I made the following configure: configure --target=xscale-elf --prefix=/usr/local/arm/3.4.1 --program-prefix=xscale-elf- --with-local-prefix=/usr/local/arm/3.4.1/ --with-as=/usr/local/arm/3.4.1/bin --with-ld=/usr/local/arm/3.4.1/bin I don't know wether the configure is right. During the MAKE process, an error occurs: "configure: error: No support for this host/target combination." I think that there must be some problems when i configure the make parameters. Is there anyone compiled the gcc for arm target successfully. Please give a hand. It is better for giving a configure sample to me. Thanks a lot! Daniel From segher@kernel.crashing.org Fri Aug 27 11:16:00 2004 From: segher@kernel.crashing.org (Segher Boessenkool) Date: Fri, 27 Aug 2004 11:16:00 -0000 Subject: asm constraints In-Reply-To: <732BE51FE9901143AE04411A11CC46560484AAB5@evtexc02.tc.fluke.com> References: <732BE51FE9901143AE04411A11CC46560484AAB5@evtexc02.tc.fluke.com> Message-ID: > unsigned int tbl; > __asm__("mftbl %0" : "=r" (tbl)); [side note: mftbl is not a PowerPC insn, nor an assembler extended mnemonic. I have no idea why libopcodes accepts it]. > I'm wondering why it's wasting a register. Did you compile with optimization on? If so, what compiler version did you use? I tried with 3.4.1 and it works just fine. If you still have problems, please show the exact code (full routine, compilable as-is). > Am I specifying the constraint incorrectly? No, it's fine. Segher From sdodsley@hotmail.com Fri Aug 27 11:52:00 2004 From: sdodsley@hotmail.com (Simon Dodsley) Date: Fri, 27 Aug 2004 11:52:00 -0000 Subject: Problem with g++ on Tru64 5.1B (gcc 3.4.1) Message-ID: Hi I am new to compiling gcc, so please bear with me if I am just being stupid. Have built 3.4.1 on a alphaev68-osf-5.1 system. gcc seems to be fine, but g++ is failing continuously. It can't find any include files and the libstdc++ libraries don't seem to exist anywhere. I specified c++ in the enable-languages switch. Anyone else seen this? Have I missed a simple step, or this this a real problem? Regards, Simon From arno.wilhelm@profile.co.at Fri Aug 27 12:11:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Fri, 27 Aug 2004 12:11:00 -0000 Subject: template-id does not match any template declaration In-Reply-To: References: Message-ID: <1093605413.24261.1.camel@dione.profile.co.at> > I am a novice for C++, and I compiled a program with C++ and there are an > error, Pleaes help me. Try this: 1 #include 2 3 4 template 5 class pair 6 { 7 public: 8 pair(T first, T second) {value1=first; value2=second;} 9 T module () {return 0;} 10 11 private: 12 T value1; 13 T value2; 14 }; 16 17 template <> 18 class pair 19 { 20 public: 21 pair (int first, int second) {value1=first; value2=second;} 22 int module ( ) { return (value1 % value2); } 23 private: 24 int value1; 25 int value2; 26 }; 35 36 int main (void) 37 { 38 pair myints (100, 75); 39 pair myfloats (100.0, 75.0); 40 41 std::cout << myints.module() << '\n'; 42 std::cout << myfloats.module() << '\n'; 43 44 return 0; 45 } 46 Arno > Thanks, > > #include > > template > class pair { > T value1, value2; > public: > pair (T first, T second) > {value1=first; value2=second;} > T module () {return 0;} > }; > > template <> > class pair { > int value1, value2; > public: > pair (int first, int second) > {value1=first; value2=second;} > int module (); > }; > > template <> > int pair::module() { > return value1%value2; > } > int main () { > pair myints (100,75); > pair myfloats (100.0,75.0); > std::cout << myints.module() << '\n'; > std::cout << myfloats.module() << '\n'; > return 0; > } > > Error: > templatemodule1.cpp:22: error: template-id `module<>' for `int > pair::module()' does not match any template declaration > templatemodule1.cpp:22: error: syntax error before `{' token > > _________________________________________________________________ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail -- Arno Wilhelm proFILE Computersysteme GmbH From artur@alice.phy.uct.ac.za Fri Aug 27 12:18:00 2004 From: artur@alice.phy.uct.ac.za (Artur Szostak) Date: Fri, 27 Aug 2004 12:18:00 -0000 Subject: using keyword problem Message-ID: <200408271352.03444.artur@alice.phy.uct.ac.za> Why does the following code not compile under GCC? Is this not valid C++? class A { public: struct S { int x; }; }; int Method() { using A::S; S s; s.x = 1; return s.x; }; When compiling the above code as is from source file main.cxx the following output is generated: $ g++ main.cxx -o test main.cxx: In function `int Method()': main.cxx:12: parse error before `::' token main.cxx:14: `S' undeclared (first use this function) main.cxx:14: (Each undeclared identifier is reported only once for each function it appears in.) main.cxx:15: `s' undeclared (first use this function) $ -- Artur Szostak Physics Department University of Cape Town Rondebosch 7701 South Africa Work: +27 21 650 3356 Mobile: +27 82 297 9502 Email: artur@alice.phy.uct.ac.za or artursz@iafrica.com From suresh@comodogroup.com Fri Aug 27 12:27:00 2004 From: suresh@comodogroup.com (L.Suresh) Date: Fri, 27 Aug 2004 12:27:00 -0000 Subject: using keyword problem Message-ID: <1093608668.5336.103.camel@Ironwing> The using-declaration is used to bring every declaration with a given name into scope. Here when you say A::S, there is no namespace "A", it is the name of the class. Try the code below. class A { public: struct S { int x; }; }; int Method() { A::S s; s.x = 1; return s.x; }; Thanks, L.Suresh From eljay@adobe.com Fri Aug 27 15:03:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 27 Aug 2004 15:03:00 -0000 Subject: using keyword problem In-Reply-To: <200408271352.03444.artur@alice.phy.uct.ac.za> References: <200408271352.03444.artur@alice.phy.uct.ac.za> Message-ID: <6.1.2.0.2.20040827071730.01f2c210@iplan-mn.corp.adobe.com> Hi Artur, The "using" keyword is for bring identifiers from one namespace available in the current namespace. For example: using std::cout; // cout is now accessible, without the std:: qualifier. using namespace std: // the whole std:: uberverse is accessible. Avoid collisions! A class and a struct or sort of like namespaces, and also not like namespaces. You want to do this... class A { public: struct S { int x; }; }; int Method() { typedef A::S S; // using A::S is no good here. S s; s.x = 1; return s.x; }; HTH, --Eljay From eljay@adobe.com Fri Aug 27 15:04:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 27 Aug 2004 15:04:00 -0000 Subject: template-id does not match any template declaration In-Reply-To: References: Message-ID: <6.1.2.0.2.20040827072207.01e4ae88@iplan-mn.corp.adobe.com> Hi, You were almost there! Just a little syntax tweak for your separate definition of your member function of your explicit template specialization for pair::module. (See below.) Also, I changed the return statement on your general pair template pair::module to something more suitable. Caution, there is a std::pair. Your ::pair is okay, but could be a little better protected by putting your pair class in your own namespace. Or, make sure you never do a "using namespace std" anywhere (I disparage "pulling in the std uberverse namespace" on general principle). HTH, --Eljay ------------------------------- #include using std::cout; template class pair { T value1; T value2; public: pair(T first, T second) { value1 = first; value2 = second; } T module() { return T(); } }; template <> class pair { int value1; int value2; public: pair(int first, int second) { value1 = first; value2 = second; } int module(); }; int pair::module() { return value1 % value2; } int main() { pair myints(100, 75); pair myfloats(100.0, 75.0); cout << myints.module() << '\n'; cout << myfloats.module() << '\n'; } From Nils.Dehn@t-online.de Fri Aug 27 15:14:00 2004 From: Nils.Dehn@t-online.de (Nils.Dehn@t-online.de) Date: Fri, 27 Aug 2004 15:14:00 -0000 Subject: Linker library search path Message-ID: <1C0iGW-0GM8My0@filter04.bbul.t-online.de> SuSE Linux 2.4.21-215-smp gcc-3.4.0 My machines comes with a kerberos pre-installed ( /usr/lib/libkrb5.so.17 ). I have a self compiled kerberos at /db/opt/krb5-1.3.4/lib/libkrb5.so.3.2). I'd like to compile an apache module shared library against my kerberos libkrb5.so.3.2 version. Using linker options -L /db/opt/krb5-1.3.4/lib/libkrb5.so.3.2 -l krb5 and libkrb5.so.3.2 being in LD_LIBRARY_PATH I still find (using ldd) that my module is linked against BOTH libkrb5.so.17 AND libkrb5.so.3.2 Obviously the linker first tries to resolve the symbols using it's default path /usr/lib and then looks for the remaining symbols in the -L path. How can I get the linker from looking is /usr/lib first ? For security reasons: I cannot alter the contents of /usr/lib. I cannot refresh the library cache using ldconfig. Thank you in advance Nils From david@thekramers.net Fri Aug 27 15:16:00 2004 From: david@thekramers.net (David Kramer) Date: Fri, 27 Aug 2004 15:16:00 -0000 Subject: AIX architecture problems Message-ID: Background: AIX 5.2 box. My mission is to port my company's application from AIX's native xlC compiler to the GNU toolchain. I bootstraped gcc 3.4.0 from a gcc 3.3.3 (build for AIX5.1) I downloaded. I built gcc with an architecture of "powerpc-ibm-aix5.2.0.0". I'm still using a binutils built by someone else. I can tell you this: /opt/local/bin/ld: supported targets: aixcoff-rs6000 aix5coff64-rs6000 srec symbolsrec tekhex binary ihex /opt/local/bin/ld: supported emulations: aix5ppc /opt/local/bin/ld: emulation specific options: no emulation specific options. /opt/local/bin/ld -v GNU ld version 2.14 20030612 > lsattr -E -l proc0 (there are 4 identical processors) frequency 339999568 Processor Speed False state enable Processor state False type PowerPC_RS64-II Processor type False I've got all the code compiled using g++ to .o files after some pretty significant changes, but linking produces output I don't understand. Here's a shortened version of the output: g++ -I. -I../common -I/dkramer/build/dhgcc340/trunk/rogue -I/dkramer/build/dhgcc340/trunk/rogue -I/dkramer/build/dh gcc340/trunk/dbaccess -g -DDEBUG -D_DEBUG -DRWDEBUG -DUSE_SYB -DSHOWSQL -Daix -DRS6000 -Daix_ansi -D_RWCONFIG=xsd -DRWTLS7 -DRWDB5 -L/software/sybase/sybase125/OCS-12_5/lib -L/dkramer/build/dhgcc340/trunk/lib -DUSE_FS -D DISABLE_SHLIB_ACCESS=1 -DRW_NO_LEADING_UNDERSCORE -DRWDB_SYB_DBLIB -Wno-deprecated -o gensql gensql.o rpttype.o /dkramer/build/dhgcc340/trunk/lib/rwctlxsd.o -ltcdbd -lrfac0d -lctl52-xsd -ldbt52-xsd -ltccommond -ltls77- xsd -ltcl -lct -lcs -lblk -lnsl -lcomn -lintl -ldl -lm /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/lib/libm.a(log10.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/lib/libm.a(tan.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/lib/libm.a(round.o)' is incompatible with rs6000:6000 output ... /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_divdi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_moddi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_udivdi3.o)' is incompatible with rs6000:6000 output An off-list post directed me towards the -m options and the -mcpu= option. Which combination of -mfoo and -mcpu=foo do I need, based on the lsattr output above, and the "is incompatible with rs6000:6000 output" message? -Do I need to just specify one or more of those command line option I'm missing? -Do I need to rebuild the compiler itself with this option? I'm guessing I do, since it's complaining about its own libraries that got built with it -Do I need to rebuild the compiler itself with this option? I'm guessing I do, since it's complaining about its own libraries that got built with it. Thanks in advance. Apologies in advance if this is something stupid; this is the first time I've done something like this. I did STFW, but most of the references I found were problems with 32/64 bit incompatibilities, which I don't think is the problem here. From eljay@adobe.com Fri Aug 27 16:17:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 27 Aug 2004 16:17:00 -0000 Subject: Linker library search path In-Reply-To: <1C0iGW-0GM8My0@filter04.bbul.t-online.de> References: <1C0iGW-0GM8My0@filter04.bbul.t-online.de> Message-ID: <6.1.2.0.2.20040827101155.01f2e090@iplan-mn.corp.adobe.com> Hi Nils, One way is to specify the fully qualified file name to your own krb5... gcc -o myapp myapp.cpp /db/opt/krb5-1.3.4/lib/libkrb5.so.3.2/libkrb5.so.3.2 ...and don't use the -L and -l parameters. HTH, --Eljay From eljay@adobe.com Fri Aug 27 21:24:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Fri, 27 Aug 2004 21:24:00 -0000 Subject: [Fwd: GCC Specific warning to error] In-Reply-To: <412D8D57.7020204@ptc.com> References: <412D8D57.7020204@ptc.com> Message-ID: <6.1.2.0.2.20040827101514.01e3b678@iplan-mn.corp.adobe.com> Hi Amit, >Is there any way where I can tell the compiler to make a particular warning to represent as error like we do it in 'cl' with the use of 'pragma' ? You can turn off all warnings, then turn on the warnings you are interested in, and then turn all warnings-into-errors. All on the command line invocation of gcc (or g++) as the compiler/linker. That's about as close as you can get, though. HTH, --Eljay From thl@dev.de.cw.com Sat Aug 28 09:06:00 2004 From: thl@dev.de.cw.com (Thomas Lotterer) Date: Sat, 28 Aug 2004 09:06:00 -0000 Subject: Problem with g++ on Tru64 5.1B (gcc 3.4.1) In-Reply-To: References: Message-ID: <20040827161727.GF86691@dev.de.cw.com> Maybe OpenPKG can help you. It is a cross platform packaging solution and all CORE packages are known to work on Tru64 5.1. Have a look http://www.openpkg.org and give it a try. OpenPKG focuses on sources which implies a chicken-egg problem but you can find unofficial binaries at http://www.zfos.org/openpkg.html -- Thomas.Lotterer@cw.com, Cable & Wireless From david@thekramers.net Sat Aug 28 11:29:00 2004 From: david@thekramers.net (David Kramer) Date: Sat, 28 Aug 2004 11:29:00 -0000 Subject: "Arg list too long" during bootstrap Message-ID: I am bootstrapping gcc 3.4.0 on AIX 5.2 from a binary 3.3.3 I downloaded (compiled for 5.1: I could not find a 5.2 one). The command I used is: ../gcc340src/configure --enable-languages=c,c++ --prefix=/opt/gcc3.4.0 --with-cpu-rs64a make -j 12 bootstrap $CC=/usr/local/bin/gcc -mcpu=rs64a About an hour and a half into the process, I get this: generating symbol list for `libstdc++.la' nm -B -X32_64 -BCpg .libs/allocator.o .libs/codecvt.o .libs/complex_io.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/globals_locale.o .libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/locale-inst.o .libs/locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-inst.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .libs/c++locale.o ../libmath/.libs/libmath.a ../libsupc++/.libs/libsupc++convenience.a | awk '{ if ((($2 == "T") || ($2 == "D") || ($2 == "B")) && (substr($3,1,1) != ".")) { print $3 } }' | sort -u > .libs/libstdc++.exp /dkramer/bldgcc340wa/gcc/xgcc -shared-libgcc -B/dkramer/bldgcc340wa/gcc/ -nostdinc++ -L/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src -L/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src/.libs -B/opt/gcc3.4.0/powerpc-ibm-aix5.2.0.0/bin/ -B/opt/gcc3.4.0/powerpc-ibm-aix5.2.0.0/lib/ -isystem /opt/gcc3.4.0/powerpc-ibm-aix5.2.0.0/include -isystem /opt/gcc3.4.0/powerpc-ibm-aix5.2.0.0/sys-include -pthread -shared -o .libs/libstdc++.so.6 .libs/allocator.o .libs/codecvt.o .libs/complex_io.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/globals_locale.o .libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/locale-inst.o .libs/locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-inst.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/basic_file.o .libs/c++locale.o -L/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src -L/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src/.libs -lm ../libmath/.libs/libmath.a -lm ../libsupc++/.libs/libsupc++convenience.a -lm -L/dkramer/bldgcc340wa/gcc/pthread -L/dkramer/bldgcc340wa/gcc -L/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/pthread -L/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0 -L/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/../../../pthread -L/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/../../.. -lgcc_s_pthread -lpthreads -lc -lgcc_s_pthread -lm -lgcc_s_pthread -lpthreads -lc -lgcc_s_pthread -Wl,-G -Wl,-bE:.libs/libstdc++.exp -Wl,-bnoentry ${wl}-berok xgcc: installation problem, cannot exec `/dkramer/bldgcc340wa/gcc/collect2': Arg list too long make[7]: *** [libstdc++.la] Error 1 make[7]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3/src' make[6]: *** [all-recursive] Error 1 make[6]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3' make[5]: *** [all] Error 2 make[5]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/pthread/libstdc++-v3' make[4]: *** [multi-do] Error 1 make[4]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/libstdc++-v3' make[3]: *** [all-multi] Error 2 make[3]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/libstdc++-v3' make[2]: *** [all] Error 2 make[2]: Leaving directory `/dkramer/bldgcc340wa/powerpc-ibm-aix5.2.0.0/libstdc++-v3' make[1]: *** [all-target-libstdc++-v3] Error 2 make[1]: Leaving directory `/dkramer/bldgcc340wa' make: *** [bootstrap] Error 2 *** Endinging 'make -j 12 bootstrap' at 0408271707 This is the second time I saw this. After the first time, I STWF and found that it could mean the commands were too long (due to paths), so I moved everything to my home directory so all the paths are shorter. Still got it, now I'm down three hours. Is there anything else that can cause this, or a way around it? Thanks in advance. From bjg@network-theory.co.uk Sat Aug 28 23:51:00 2004 From: bjg@network-theory.co.uk (Brian Gough) Date: Sat, 28 Aug 2004 23:51:00 -0000 Subject: "Arg list too long" during bootstrap In-Reply-To: David Kramer's message of "Fri, 27 Aug 2004 17:24:48 -0400 (EDT)" References: Message-ID: <87vff3einw.fsf@network-theory.co.uk> David Kramer writes: > I am bootstrapping gcc 3.4.0 on AIX 5.2 from a binary 3.3.3 I downloaded > (compiled for 5.1: I could not find a 5.2 one). > ... > xgcc: installation problem, cannot exec > `/dkramer/bldgcc340wa/gcc/collect2': Arg list too long > > This is the second time I saw this. After the first time, I STWF and found > that it could mean the commands were too long (due to paths), so I moved > everything to my home directory so all the paths are shorter... > > Is there anything else that can cause this, or a way around it? Generally it is the number of arguments that is the issue. There is usually a way to increase the limit with a kernel parameter (via smitty chgsys on AIX, I think). -- Brian Gough Network Theory Ltd, Publishing "An Introduction to GCC" --- http://www.network-theory.co.uk/gcc/ From foskey@optushome.com.au Sun Aug 29 15:26:00 2004 From: foskey@optushome.com.au (Ken Foskey) Date: Sun, 29 Aug 2004 15:26:00 -0000 Subject: "Arg list too long" during bootstrap In-Reply-To: <87vff3einw.fsf@network-theory.co.uk> References: <87vff3einw.fsf@network-theory.co.uk> Message-ID: <1093692558.1729.302.camel@froddo.foskey.org.au> On Sat, 2004-08-28 at 19:06, Brian Gough wrote: > Generally it is the number of arguments that is the issue. There is > usually a way to increase the limit with a kernel parameter (via > smitty chgsys on AIX, I think). arg lists are generally the shell not system. If you can figure out a script name you could try switching the #!/bin/sh line to your bash line. ksh (sh in aix generally) has a 1k or 2k limit whereas bash has 4k. You could also tweak the script to use xargs if appropriate. -- Thanks KenF OpenOffice.org developer From slamb@slamb.org Mon Aug 30 06:44:00 2004 From: slamb@slamb.org (Scott Lamb) Date: Mon, 30 Aug 2004 06:44:00 -0000 Subject: Upgrade "may not respond to" warning to error Message-ID: <2ECF1286-F94D-11D8-8E7F-000A95891440@slamb.org> I'd like to have warnings like this: someFile.m:XXX:warning: `SomeObjcClass' may not respond to `-someMessage:' become errors, while not affecting other warnings. So I have two questions: 1) What's the flag for this message? I see -Wundeclared-selector, but that seems to be a slightly different case. 2) Is it possible to do something like -Werror on just some warnings? I'd like some other types of warnings (say, the signedness ones) to be just warnings. I want to see them, but I don't want them to cause compilation to fail. Thanks, Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: From marcel.lanz@ds9.ch Mon Aug 30 08:24:00 2004 From: marcel.lanz@ds9.ch (Marcel Lanz) Date: Mon, 30 Aug 2004 08:24:00 -0000 Subject: build based on a binary only distribution Message-ID: <20040829152557.GA32234@ds9.ch> I have a binary only distrubution of the gcc suite (binutils, newlib, gcc). I wan't to build the equal toolchain for an another platform. Can I do that with the help of the given binaries ? Can those binaries "say me" how they where built ? Can the specs file be a help for that ? Marcel From arno.wilhelm@profile.co.at Mon Aug 30 08:33:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Mon, 30 Aug 2004 08:33:00 -0000 Subject: build based on a binary only distribution In-Reply-To: <20040829152557.GA32234@ds9.ch> References: <20040829152557.GA32234@ds9.ch> Message-ID: <1093848289.2698.1.camel@dione.profile.co.at> > I have a binary only distrubution of the gcc suite (binutils, newlib, gcc). I wan't to > build the equal toolchain for an another platform. Can I do that with the help of the > given binaries ? Can those binaries "say me" how they where built ? That might help: > gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) Arno From snodx@hotmail.com Mon Aug 30 08:40:00 2004 From: snodx@hotmail.com (snodx@hotmail.com) Date: Mon, 30 Aug 2004 08:40:00 -0000 Subject: Spam: Can macros be expanded only during the start of a program? Message-ID: <00a801c48e6c$9911a8a0$940318ac@mahindrabt.com> Hi everybody, I am trying out a rather complex build of an open source package containing some hundreds of '.c' and '.h' modules. I am getting stuck up at one point. The portion of the code that is failing goes something like this (in pseudocode language) .......Statement.......... .......Statement.......... MACRO EXPANSION .......Statement.......... .......Statement.......... The macro is mapped to a function and the expansion occurs in between some set of statements. The make is failing at this line with the error: MACRO EXPANSION Invalid statement I am looking into the problem. However I just wanted to know one thing (a newbie question you could say), just as in between a set of statements you cant declare a new variable by saying "int x" or something is it also the case that macros can only be expanded only at the declaration-of-variables stage? Thanks in advance. SNODX From snodx@hotmail.com Mon Aug 30 09:43:00 2004 From: snodx@hotmail.com (snodx@hotmail.com) Date: Mon, 30 Aug 2004 09:43:00 -0000 Subject: Last posting not a spam. "Spam" keyword getting prepended automatically Message-ID: <00bc01c48e6d$bd0494b0$940318ac@mahindrabt.com> Hi list, I observed that my last posting got prepended with the word "Spam" whereas I am not spamming the list at all. Can the list administrator please look into this? Thanks in advance. SNODX From hueffner@informatik.uni-tuebingen.de Mon Aug 30 10:52:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Mon, 30 Aug 2004 10:52:00 -0000 Subject: Spam: Can macros be expanded only during the start of a program? In-Reply-To: <00a801c48e6c$9911a8a0$940318ac@mahindrabt.com> (snodx@hotmail.com's message of "Mon, 30 Aug 2004 14:07:34 +0530") References: <00a801c48e6c$9911a8a0$940318ac@mahindrabt.com> Message-ID: <87y8jx81dd.fsf@informatik.uni-tuebingen.de> writes: > I am looking into the problem. However I just wanted to know one > thing (a newbie question you could say), just as in between a set of > statements you cant declare a new variable by saying "int x" or > something is it also the case that macros can only be expanded only > at the declaration-of-variables stage? No. -- Falk From learning_c@hotmail.com Mon Aug 30 11:17:00 2004 From: learning_c@hotmail.com (learning c++) Date: Mon, 30 Aug 2004 11:17:00 -0000 Subject: Which header should I include for "reverse" Message-ID: Hi, Everyone: I compiled a short program to use "reverse" like this: #include #include int main() { double A[6] = { 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 }; reverse(A, A + 6); for (int i = 0; i < 6; ++i) std::cout << "A[" << i << "] = " << A[i]; return 0; } But the error is: reverse.cpp: In function `int main()': reverse.cpp:7: error: `reverse' undeclared (first use this function) reverse.cpp:7: error: (Each undeclared identifier is reported only once for each function it appears in.) Thanks in advance! _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From arno.wilhelm@profile.co.at Mon Aug 30 12:08:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Mon, 30 Aug 2004 12:08:00 -0000 Subject: Which header should I include for "reverse" In-Reply-To: References: Message-ID: <1093863119.2698.4.camel@dione.profile.co.at> Have not tried it out but maybe "using namespace std;" or "std::reverse" would help ? regards, Arno On Mon, 2004-08-30 at 11:43, learning c++ wrote: > Hi, Everyone: > > I compiled a short program to use "reverse" like this: > > #include > #include > > int main() { > > double A[6] = { 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 }; > reverse(A, A + 6); > for (int i = 0; i < 6; ++i) > std::cout << "A[" << i << "] = " << A[i]; > return 0; > } > > But the error is: > reverse.cpp: In function `int main()': > reverse.cpp:7: error: `reverse' undeclared (first use this function) > reverse.cpp:7: error: (Each undeclared identifier is reported only once for > each function it appears in.) > > Thanks in advance! > _________________________________________________________________ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail -- Arno Wilhelm proFILE Computersysteme GmbH From help@hotmail.com Mon Aug 30 12:46:00 2004 From: help@hotmail.com (help@hotmail.com) Date: Mon, 30 Aug 2004 12:46:00 -0000 Subject: Help. Message-ID: Hello: I am Chinese. I have some trouble. Can you help me ? I have paypal account ,but i can't get paypal money in China. Do you have paypal ? If you have ,i want to send money to you ,then you return the money to me by western union. I give you some fee. For example: I send u $500, i will give you $50,you return $450USD. Are you agree? If you agree with me ,please contact me , my icq is : 277851088 Thank you I wait your reply. From eljay@adobe.com Mon Aug 30 16:01:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 30 Aug 2004 16:01:00 -0000 Subject: Upgrade "may not respond to" warning to error In-Reply-To: <2ECF1286-F94D-11D8-8E7F-000A95891440@slamb.org> References: <2ECF1286-F94D-11D8-8E7F-000A95891440@slamb.org> Message-ID: <6.1.2.0.2.20040830065939.01f64ec0@iplan-mn.corp.adobe.com> Hi Scott, >What's the flag for this message? I'm not sure. (I haven't familiarized myself with Objective-C. Which is ironic, since I'm an OS X person.) Refer to ... http://gcc.gnu.org/onlinedocs/gcc-3.4.1/gcc/Objective-C-Dialect-Options.html http://gcc.gnu.org/onlinedocs/gcc-3.4.1/gcc/Warning-Options.html >Is it possible to do something like -Werror on just some warnings? No. It's possible to doing something similar, using one of three different strategies: 1) edit the GCC source code and make the identified warnings errors. Rebuild your custom GCC. 2) post-process the output (using sed, for instance) and "upgrade" warnings to errors. Not quite the same thing, doesn't abort the compile, but may be "good enough". You can use that in conjunction with grep to detect for the upgraded warnings, and abort a make file by returning a failing error code. 3) have your build process perform two passes. The first pass enables all the warnings you want to see, the second pass enable only the warnings you want to be elevated to errors and turn on the -Werror flag. Those are just a few ideas off the top of my head. HTH, --Eljay From eljay@adobe.com Mon Aug 30 16:09:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 30 Aug 2004 16:09:00 -0000 Subject: Help Needed In-Reply-To: <20040830122911.24797.qmail@webmail17.rediffmail.com> References: <20040830122911.24797.qmail@webmail17.rediffmail.com> Message-ID: <6.1.2.0.2.20040830074447.01e9a420@iplan-mn.corp.adobe.com> Hi Karthik, This will do what you want... http://spirit.sourceforge.net HTH, --Eljay From steve@millersnet.net Mon Aug 30 16:19:00 2004 From: steve@millersnet.net (steve@millersnet.net) Date: Mon, 30 Aug 2004 16:19:00 -0000 Subject: how to combine gcc and binutils source into one tree Message-ID: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> >they have common directories libiberty,include,texinfo,config, etc.... >what is the best way to merge them? > > >thanks in advance >Steven I ask this question last week, is this not the right list for this question? From eljay@adobe.com Mon Aug 30 16:52:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 30 Aug 2004 16:52:00 -0000 Subject: how to combine gcc and binutils source into one tree In-Reply-To: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> References: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> Message-ID: <6.1.2.0.2.20040830110349.01e48f90@iplan-mn.corp.adobe.com> Hi Steve, >I ask this question last week, is this not the right list for this question? This is the right list for your question. This list is a user-community volunteer list. Questions are posed by anyone, worldwide, and answers are provided by anyone, worldwide. Those who regularly answer questions are, what I'd call, self-nominated "experts" on GCC. There's only a few that are part of FSF or GCC developers per se. So if you ask a question that no one on the "panel of experts" can answer, you end up with (in radio terms) dead air. I know that this doesn't answer your initial question, but it does explain why no one volunteered an answer. I, for one, do not know the answer to your initial question. I'm more of a "C++ language lawyer" than a "nitty gritty internals of GCC guru". --Eljay From david@thekramers.net Mon Aug 30 17:04:00 2004 From: david@thekramers.net (David Kramer) Date: Mon, 30 Aug 2004 17:04:00 -0000 Subject: how to combine gcc and binutils source into one tree In-Reply-To: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> References: <1969.192.168.0.4.1093881872.squirrel@nautilus.tsunami.us> Message-ID: On Mon, 30 Aug 2004 steve@millersnet.net wrote: > >they have common directories libiberty,include,texinfo,config, etc.... > >what is the best way to merge them? > > > > > >thanks in advance > >Steven > > I ask this question last week, is this not the right list for this question? I will give it my best shot, but I am acutally new to compiling gcc/binutils myself. Gaining Way Too Much experience in it in the last week or so though. In combining projects like this in general, if those common directories have completely identical contents, then you can pull it off. The way you integrate them is by changing the master Makefile to call the new directories too, and to make sure the install targets for the new directories get called too. If I were a betting man (which I'm not), I would try something devious like: - Untar package A into DIR1 - Untar package B into DIR2 - Copy the unique directories from package B to DIR1 - Copy the main Makefile of package B to $DIR1/Makefile.packageb - cd $DIR1 - Configure and make package A - Make package B using the makefile Makefile.packageb One obstacle I fear is that their configure scripts will need different things. I would be fascinated to hear whether this works or not. Let me know. I would also be interested in hearing why you want to do this though. TO save 20 minutes of compile time? ---------------------------------------------------------------------------- DDDD David Kramer david@thekramers.net http://thekramers.net DK KD DKK D You don't usually hear "hydraulics" and "simplicity" DK KD in the same sentence. DDDD Cathy Rogers, Junkyard Wars From steve@millersnet.net Mon Aug 30 17:10:00 2004 From: steve@millersnet.net (steve@millersnet.net) Date: Mon, 30 Aug 2004 17:10:00 -0000 Subject: how to combine gcc and binutils source into one tree Message-ID: <2087.192.168.0.4.1093884933.squirrel@nautilus.tsunami.us> the linux kernel docs say use gcc 2.95.3 and the latest binutils. However some packages like glibc won't build with 2.95.3 so you end up with 2 versions of gcc and 2 versions of binutils on the same system. While you can manage this, should you get your wires crossed it could make for some strange results. Perhaps I'm making the wrong approach, in the end I just want two seperate toolchains. Since I will be putting both versions on multiple machines I'm looking for a good way to package everything. I'll post any success in doing this. From david@thekramers.net Mon Aug 30 17:22:00 2004 From: david@thekramers.net (David Kramer) Date: Mon, 30 Aug 2004 17:22:00 -0000 Subject: how to combine gcc and binutils source into one tree In-Reply-To: <2087.192.168.0.4.1093884933.squirrel@nautilus.tsunami.us> References: <2087.192.168.0.4.1093884933.squirrel@nautilus.tsunami.us> Message-ID: On Mon, 30 Aug 2004 steve@millersnet.net wrote: > the linux kernel docs say use gcc 2.95.3 and the latest binutils. However > some packages like glibc won't build with 2.95.3 so you end up with 2 > versions of gcc and 2 versions of binutils on the same system. While you > can manage this, should you get your wires crossed it could make for some > strange results. Perhaps I'm making the wrong approach, in the end I just > want two seperate toolchains. Since I will be putting both versions on > multiple machines I'm looking for a good way to package everything. I'll > post any success in doing this. Ah! I see. I'm going through similar issues now. I think the solution to your problem is not to control how they are built, but how they are installed. If you configure and make them with --with-prefix=, you can install them in different places, and have your $PATH set up one way or another to use one version or another. In my login scripts I have: $ORIGPATH- the path without any devel tools, so I can always get a clean path without duplcation. $PATH- Set to $ORIGPATH $GCC340PATH- Set to the bin directories for gcc 3.4.0 toolchain $GCC333PATH- Set to the bin directories for gcc 3.3.3 toolchain $XLCPATH- Set to the bin directories for the native xlC toolchain To switch toolchains, I just issue a command like export PATH=$GCC340PATH:$ORIGPATH Or make scripts (remember to source them, not run them) or aliases to do the same thing. If you decide to install them under opt, use --with_prefix=/opt/gcc3.3.3 or --with_prefix==/opt/gccc3.4.0 or whatever. To package them all up, install all the versions on one machine, and tar up the installed versions like "cd /opt; tar cvf /tmp/gcc_all.tar gcc*". Everything goes under the prefix directory, so that should work. ---------------------------------------------------------------------------- DDDD David Kramer david@thekramers.net http://thekramers.net DK KD DKK D You don't usually hear "hydraulics" and "simplicity" DK KD in the same sentence. DDDD Cathy Rogers, Junkyard Wars From learning_c@hotmail.com Mon Aug 30 17:25:00 2004 From: learning_c@hotmail.com (learning c++) Date: Mon, 30 Aug 2004 17:25:00 -0000 Subject: function object, function pointer and function. Message-ID: Hi, Everyone: I compiled a short code that invovles function object and function pointer. in the line: int count1 = count_if(v1.begin(), v1.end(), &lessThan20Function); I used the funtion poiter to pass the address of function. It works very well, However, when I deleted the symbol "&", it still works. "lessThan20Function" is the name of function. Can we use the function name as an argument? What is the advantage of function object? Thanks in advanace! #include #include #include using namespace std; bool lessThan20Function(int value) { return value < 20; } class LessThan20 { public: bool operator() (int value) const { return value < 20; } }; int main() { int iarr[10] = {2,4,55,6,66,10,22,14,70,1234}; vector v1(iarr, iarr+10); LessThan20 lt20; // count_if(start_iterator, end_iterator, predicate); // Pointer to a function as argument int count1 = count_if(v1.begin(), v1.end(), &lessThan20Function); cout << "There are " << count1 << " values less than 20" << endl; // Function object as argument int count2 = count_if(v1.begin(), v1.end(), lt20); cout << "There are " << count2 << " values less than 20" << endl; return 0; ] _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail From steve@millersnet.net Mon Aug 30 17:42:00 2004 From: steve@millersnet.net (steve@millersnet.net) Date: Mon, 30 Aug 2004 17:42:00 -0000 Subject: how to combine gcc and binutils source into one tree Message-ID: <2162.192.168.0.4.1093886737.squirrel@nautilus.tsunami.us> ok that seems to be an easier way to handle things. I'm wondering which will work better when configuring gcc use --with-prefix=/opt/gcc-2.95.3 and when configuring binutils use --with-prefix=/opt/binutils-2.15 this would keep everything contained to their own directories or gcc use --with-prefix=/opt/gnu and binutils use --with-prefix=/opt/gnu ..... would the latter work as well seeing how both gcc and binutils have common components? From eljay@adobe.com Mon Aug 30 18:22:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Mon, 30 Aug 2004 18:22:00 -0000 Subject: function object, function pointer and function. In-Reply-To: References: Message-ID: <6.1.2.0.2.20040830121802.01f2b8d0@iplan-mn.corp.adobe.com> Hi, In the situation you presented, the & in your "int count1 = count_if(v1.begin(), v1.end(), &lessThan20Function);" line is superfluous. Although it is perfectly good code, and acceptable to all compilers. In my experience, it would be omitted. By convention. Also in my experience, there is a preference to function objects over function pointers. For some really neat stuff, the BOOST (www.boost.org) library has a lambda library, which would allow you to put the body of the predicate right in your count_if statement -- and in a quite abbreviated form. It'd look something like... int count = count_if(v1.begin(), v1.end(), _1 > 20); HTH, --Eljay From david@thekramers.net Mon Aug 30 18:28:00 2004 From: david@thekramers.net (David Kramer) Date: Mon, 30 Aug 2004 18:28:00 -0000 Subject: how to combine gcc and binutils source into one tree In-Reply-To: <2162.192.168.0.4.1093886737.squirrel@nautilus.tsunami.us> References: <2162.192.168.0.4.1093886737.squirrel@nautilus.tsunami.us> Message-ID: On Mon, 30 Aug 2004 steve@millersnet.net wrote: > ok that seems to be an easier way to handle things. I'm wondering which > will work better when configuring gcc use --with-prefix=/opt/gcc-2.95.3 > and when configuring binutils use --with-prefix=/opt/binutils-2.15 this > would keep everything contained to their own directories or gcc use > --with-prefix=/opt/gnu and binutils use --with-prefix=/opt/gnu ..... would > the latter work as well seeing how both gcc and binutils have common > components? Each package needs a different --with-prefix option. That's the least risky way to do it. You can settle any conflicts with your $PATH, and you can even try differernt gcc's with different binutil's that way. Though doing --with-prefix=/opt/gnu/gcc-2.95.3 --with-prefix=/opt/gnu/binutils-2.15 ... ... wouldn't be a bad idea, so you can just tar up /opt/gnu. -- DDDD DK KD DKK D Bush/Cheney '04: Putting the "Con" in Conservative DK KD DDDD From david@thekramers.net Mon Aug 30 21:14:00 2004 From: david@thekramers.net (David Kramer) Date: Mon, 30 Aug 2004 21:14:00 -0000 Subject: install-sh not found during make install 3.4.0 Message-ID: Thanks to the help from this list on the arg list too long, I got gcc 3.4.0 compiled under AIX. When I tried to make install, I got, at various points, "/usr/local/bin/bash: ../gcc340src/install-sh: A file or directory in the path name does not exist.". When I put the full path of install-sh in the INSTALL variable in the Makefile, it works. The directory I was getting the source from (../gcc340src) is actually a symlink to another directory. Could that be the root of the problem? When I set the full path in the Makefile, I used the real path. ------------------------------------------------------------------- DDDD David Kramer http://thekramers.net DK KD "On two occasions, I have been asked [by members of DKK D Parliament], 'Pray, Mr. Babbage, if you put into the machine DK KD wrong figures, will the right answers come out?' I am not DDDD able to rightly apprehend the kind of confusion of ideas that could provoke such a question." -- Charles Babbage From saravanaprasads@yahoo.co.in Mon Aug 30 23:46:00 2004 From: saravanaprasads@yahoo.co.in (=?iso-8859-1?q?Saravana=20Prasad?=) Date: Mon, 30 Aug 2004 23:46:00 -0000 Subject: Regarding building GCC/glibc for MIPS targets Message-ID: <20040830182829.24090.qmail@web8505.mail.in.yahoo.com> Hi, ???? I'm trying to build GCC 3.2.3 (x86->mips) and LIBC 2.3.2 for various MIPS targets. I need the tool chain for MIPS little-endian/big-endian mips1/mips3 ISA. I was successful in building the mips-xxx-linux-gnu target. The tool chain works fine for big-endian mips32 target. But for little endian target, it is failing as the correct library (endian) was not built. Here are my questions. 1. How to build the tools chain for various target combinations ? 2. Is it possible to just build one compiler (instead f mipsel-xx, mipseb-xxx etc) and a set of libraries to do the job ? If yes, do I need to use multilib option ? If so, how to use it ? I tried with the following option, but only the big-endian target got built. MULTILIB_OPTIONS = msoft-float/msingle-float EL/EB mips1/mips3 MULTILIB_DIRNAMES = soft-float single el eb mips1 mips3 ???? Please advice. TIA, Saravana ________________________________________________________________________ Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony From david@thekramers.net Tue Aug 31 02:54:00 2004 From: david@thekramers.net (David Kramer) Date: Tue, 31 Aug 2004 02:54:00 -0000 Subject: AIX architecture problems continued Message-ID: Background: AIX 5.2 box. My mission is to port my company's application from AIX's native xlC compiler to the GNU toolchain. I bootstraped gcc 3.4.0 from a gcc 3.3.3 (build for AIX5.1) I downloaded. I built gcc with an architecture of "powerpc-ibm-aix5.2.0.0" using the -mcpu=rs64a flag. This is on a PowerPC_RS64-II according to lsattr. I have a binutils2.14 built by someone else into /opt/local/bin. I can tell you this about it: /opt/local/bin/ld: supported targets: aixcoff-rs6000 aix5coff64-rs6000 srec symbolsrec tekhex binary ihex /opt/local/bin/ld: supported emulations: aix5ppc /opt/local/bin/ld: emulation specific options: no emulation specific options. /opt/local/bin/ld -v GNU ld version 2.14 20030612 I have a binutils 2.15 that I just built myself using the gcc 3.4.0 compiler I built as outlined above, into /opt/binutils2.15/bin. I also have ld, etc, from the native xlC toolchain in /usr/bin. I wrote a little test program that just does some << and >> and stringstream conversions. Source available if you think it's important. When I try using the new compiler with the stock ld: -------------------------------- ~/build/test> export PATH=$GCC340PATH:$ORIGPATH ~/build/test> which gcc /opt/gcc3.4.0/bin/gcc ~/build/test> which ld /usr/bin/ld ~/build/test> g++ -o piddle piddle.cpp && ./piddle Before defining stringstream here After defining stringstream the process id is 94776. the number is: 56 -------------------------------- the program works fine, no errors. When I try using the new compiler with the old gnu binutils: -------------------------------- ~/build/test> export PATH=$GCC340PATH:/usr/local/bin:$ORIGPATH ~/build/test> g++ -o piddle piddle.cpp && ./piddle Before defining stringstream here After defining stringstream the process id is 28258. the number is: 56 -------------------------------- the program works fine, no errors. When I try using the new compiler with the new gnu binutils: -------------------------------- ~/build/test> export PATH=$GCC340PATH:$BINUTILSPATH:$ORIGPATH ~/build/test> which gcc /opt/gcc3.4.0/bin/gcc ~/build/test> which ld /opt/binutils2.15/bin/ld ~/build/test> g++ -o piddle piddle.cpp && ./piddle Before defining stringstream here Segmentation fault (core dumped) -------------------------------- The program dies on this line: stringstream sstr("safas"); I've tried with with various constructors, too, with the same results. Since I'm using the same exact source code and the same compiler, and only the linking process has changed in my test, it seems to me that the problem has to be the linker, no? BTW, the reason I am trying to build a new binutils, is because when I link my application, and some more complex test code, I get errors like: /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_divdi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_moddi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_udivdi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_umoddi3.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_udivmoddi4.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc_eh.a(unwind-dw2.o)' is incompatible with rs6000:6000 output /opt/local/bin/ld: warning: powerpc:601 architecture of input file `/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc_eh.a(unwind-dw2-fde.o)' is incompatible with rs6000:6000 output However, I'm not so sure it's the linker. What do you think? -- DDDD DK KD I am a nobody DKK D Nobody is perfect DK KD Therefore, I am perfect. DDDD From msharov@talentg.com Tue Aug 31 03:22:00 2004 From: msharov@talentg.com (Mike Sharov) Date: Tue, 31 Aug 2004 03:22:00 -0000 Subject: How can I tell the compiler to not store excessively? Message-ID: <4133BB9F.3010705@talentg.com> Dear gcc-help, I am trying to write several inline assembly functions to facilitate use of MMX instructions and I would like for them to be concatenated without transfer in and out of registers between calls if the data is already loaded in a register. Example: =========================================== #include typedef int mmx_t __attribute__ ((mode(V8QI))); inline void padd (const char* p, char* r) { asm ("paddb %1, %0" : "=&y"(*(mmx_t*)r) : "y"(*(const mmx_t*)p), "0"(*(mmx_t*)r)); } inline void psub (const char* p, char* r) { asm ("psubb %1, %0" : "=&y"(*(mmx_t*)r) : "y"(*(const mmx_t*)p), "0"(*(mmx_t*)r)); } int main (void) { char v1[8], v2[8]; padd (v1, v2); psub (v1, v2); printf ("v2[3] = %d\n", v2[3]); return (0); } =========================================== Here I would like to see v1 and v2 loaded into registers before the call to padd and not leave them until the return from psub. Now, gcc already can do this for the read-only v1, generating the following (-O3 -march=athlon-mp): =========================================== pxor %mm0, %mm0 movl %esp, %ebp .LCFI1: subl $24, %esp .LCFI2: movq -8(%ebp), %mm1 andl $-16, %esp #APP paddb %mm0, %mm1 #NO_APP movq %mm1, -8(%ebp) subl $16, %esp #APP psubb %mm0, %mm1 #NO_APP movq %mm1, -8(%ebp) movsbl -5(%ebp),%eax movl $.LC0, (%esp) movl %eax, 4(%esp) call printf =========================================== Here %mm0 is not reloaded because it remains the same value for both padd and psub calls. However, the value from %mm1 is stored into v2 twice; the first time after padd and the second time after psub. It is understandable that the optimizer would do this, because, for example, several threads could be accessing v2 concurrently. Is it possible to add some directives to the source code above to tell the optimizer that it is ok to keep v2 in a register until something (like the printf) actually asks for its contents through another method? -- Mike Sharov msharov@talentg.com From chris.fernando@med.monash.edu.au Tue Aug 31 03:57:00 2004 From: chris.fernando@med.monash.edu.au (Chris Fernando) Date: Tue, 31 Aug 2004 03:57:00 -0000 Subject: GNU installation Message-ID: <4133BFF2.1050400@med.monash.edu.au> Dear gcc-help, Is there a way of getting GCC installed on Linux if there is no compiler already installed on the system? The machine does not have rpm installed, either. It has been suggested that I could try using rpm2tar on an RPM binary, but I've also been told I will get a lot of gcclib problems if I do that. Any advice? Thanks -- Mr Chris Fernando Computer Systems Officer IT & MULTIMEDIA GROUP Medicine, Nursing & Health Sciences Mail: Level 3, Bld 15, Monash University Vic 3800 Phone: 9905 1335 Fax: 9905 8134 Email: chris.fernando@med.monash.edu.au Jobdesk: http://jobdesk.med.monash.edu.au ITM Website: http://itm.med.monash.edu.au From dhairesh@gmail.com Tue Aug 31 03:58:00 2004 From: dhairesh@gmail.com (Oza Dhairesh) Date: Tue, 31 Aug 2004 03:58:00 -0000 Subject: function calls before variable declarations does not give error in gcc? Message-ID: <3aa41a650408302022774d7486@mail.gmail.com> Hi, The following code does not give an error wth gcc void fun(int a){ printf("there u go %d\n",a);} int main() { char abc[10] = "the"; int a1 = 10; fun(10); int a = 1; } gcc --version gave the following o/p: gcc (GCC) 3.3.1 (SuSE Linux) Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. while wth a compiler that gave the following o/p wth gcc --version 2.96 I got the following error: test1.c: In function `main': test1.c:10: parse error before `int' why this difference? From kuganv@gmail.com Tue Aug 31 05:10:00 2004 From: kuganv@gmail.com (Kugan Vivekanandarajah) Date: Tue, 31 Aug 2004 05:10:00 -0000 Subject: constructing cfg from linked binary for arm Message-ID: <4217037d040830205772574bf2@mail.gmail.com> [Might be off topic for this list, but I could not find any list which discusses the arm gcc backend] To study the program behavior, after being linked (which will be used for application specific architecture tuning), I need to construct a control flow graph for the whole program. My target architecture is arm. I have following questions 1) Can function return take place with any other instruction other than the following? And also, can I assume that this instructions will be used only for function return a. mov pc, lr b. ldmdb fp, {r4, fp, sp, pc} 2) Instructions like the following: what is the genral use of them? a. ldr pc, [r4]. #4 b. mov pc, r8 Can I get these informations by looking arm.md file used in GCC. How des gcc generates code based on this md file. Any points, links or documents about this will be very helpful Thanks in advance, -kgn From eljay@adobe.com Tue Aug 31 05:22:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 31 Aug 2004 05:22:00 -0000 Subject: function calls before variable declarations does not give error in gcc? In-Reply-To: <3aa41a650408302022774d7486@mail.gmail.com> References: <3aa41a650408302022774d7486@mail.gmail.com> Message-ID: <6.1.2.0.2.20040830225651.01f46e20@iplan-mn.corp.adobe.com> Hi Oza, I believe that's actually not an error, according to C99. GCC 2.96 (a misnomer for a maverick non-GCC release, since there wasn't a GCC 2.96, GCC went from 2.95 to 3.0) is probably following C89 standards. HTH, --Eljay From dhairesh@gmail.com Tue Aug 31 06:31:00 2004 From: dhairesh@gmail.com (Oza Dhairesh) Date: Tue, 31 Aug 2004 06:31:00 -0000 Subject: function calls before variable declarations does not give error in gcc? In-Reply-To: <6.1.2.0.2.20040830225651.01f46e20@iplan-mn.corp.adobe.com> References: <3aa41a650408302022774d7486@mail.gmail.com> <6.1.2.0.2.20040830225651.01f46e20@iplan-mn.corp.adobe.com> Message-ID: <3aa41a650408302210d03ca6d@mail.gmail.com> Hi Thanks Eljay. But even gcc -std=c89 dosnt give an error!! BR Oza On Mon, 30 Aug 2004 22:58:44 -0500, Eljay Love-Jensen wrote: > Hi Oza, > > I believe that's actually not an error, according to C99. > > GCC 2.96 (a misnomer for a maverick non-GCC release, since there wasn't a > GCC 2.96, GCC went from 2.95 to 3.0) is probably following C89 standards. > > HTH, > --Eljay > > From bdubbs@swbell.net Tue Aug 31 06:51:00 2004 From: bdubbs@swbell.net (Bruce Dubbs) Date: Tue, 31 Aug 2004 06:51:00 -0000 Subject: Building gcc-3.4.1 Ada Message-ID: <41340B2E.6030206@swbell.net> I'm having quite a problem building Ada with 3.4.1. I set up and run configure and make bootstrap fine, but I can never get the gnatlibs_and_tools target to show up in the Makefile, so the documented process of cd gcc make gnatlibs_and_tools fails. I am using an Ada enabled base compiler and gnatbind, gnat, gnatls, etc are built. I'm not that familiar with Ada, so I'm not sure if everything that is supposed to be built is now done in the make bootstrap phase or not. Please advise. -- Bruce Dubbs From parmarp@charter.net Tue Aug 31 06:59:00 2004 From: parmarp@charter.net (ritesh parmar) Date: Tue, 31 Aug 2004 06:59:00 -0000 Subject: a question about inheriting from std::iostream Message-ID: <1093923575.6702.11.camel@nova.dominion.com> I'm not sure if this question has been asked and i couldn't find an example in all of my searches. But I'd like to write a class that would perform substitution of keywords while some other class is reading from it. I was thinking about getting streambuf from ios::rdbuf() and performing all the substitutions and then setting it back but that approach make take some time with big files. If my understanding is correct about how streambuf class works. Can anybody suggest a way of inheriting from iostream and doing the substitution on-the-fly ? From sdodsley@hotmail.com Tue Aug 31 07:10:00 2004 From: sdodsley@hotmail.com (Simon Dodsley) Date: Tue, 31 Aug 2004 07:10:00 -0000 Subject: Problem with g++ on Tru64 5.1B (gcc 3.4.1) Message-ID: >Maybe OpenPKG can help you. It is a cross platform packaging solution >and all CORE packages are known to work on Tru64 5.1. Have a look >http://www.openpkg.org and give it a try. OpenPKG focuses on sources >which implies a chicken-egg problem but you can find unofficial binaries >at http://www.zfos.org/openpkg.html Thanks for the pointer. Tried this again on another alpha and noticed that the gmake install was failing due to install-sh not being found in some of the directories. After copying it in, everything seems to work as expected. Only slight problem is that when I compile I keep getting the following warnings... as0: Warning: , line 0: Unknown architecture name: ev68 as1: Warning: , line 0: Unknown architecture name: ev68 as0: Warning: , line 0: Unknown architecture name: ev68 as1: Warning: , line 0: Unknown architecture name: ev68 Anyone know why this might be? Simon From arno.wilhelm@profile.co.at Tue Aug 31 11:48:00 2004 From: arno.wilhelm@profile.co.at (Arno Wilhelm) Date: Tue, 31 Aug 2004 11:48:00 -0000 Subject: GNU installation In-Reply-To: <4133BFF2.1050400@med.monash.edu.au> References: <4133BFF2.1050400@med.monash.edu.au> Message-ID: <1093935542.7611.1.camel@dione.profile.co.at> > Is there a way of getting GCC installed on Linux if there is no compiler > already installed on the system? The machine does not have rpm > installed, either. > > It has been suggested that I could try using rpm2tar on an RPM binary, > but I've also been told I will get a lot of gcclib problems if I do that. > > Any advice? You could try to unpack the rpm packet with mc (midnight commander) and put the library's/ececutables etc. in the proper directory by yourself. The spec file should give you a hint on where to put it. Arno From hueffner@informatik.uni-tuebingen.de Tue Aug 31 12:01:00 2004 From: hueffner@informatik.uni-tuebingen.de (Falk Hueffner) Date: Tue, 31 Aug 2004 12:01:00 -0000 Subject: How can I tell the compiler to not store excessively? In-Reply-To: <4133BB9F.3010705@talentg.com> (Mike Sharov's message of "Mon, 30 Aug 2004 19:43:27 -0400") References: <4133BB9F.3010705@talentg.com> Message-ID: <87brgr236l.fsf@informatik.uni-tuebingen.de> Mike Sharov writes: > I am trying to write several inline assembly functions to facilitate > use of MMX instructions and I would like for them to be concatenated > without transfer in and out of registers between calls if the data is > already loaded in a register. I'd recommend you use try the macros from like _m_paddb. If they don't produce proper code, please file a bug report. -- Falk From suresh@comodogroup.com Tue Aug 31 12:09:00 2004 From: suresh@comodogroup.com (L.Suresh) Date: Tue, 31 Aug 2004 12:09:00 -0000 Subject: Link problems in g++ but not in gcc!! Message-ID: <1093952856.5304.18.camel@Ironwing> Hi, I'm having link problems when i compile my program iptables.cpp with g++. I have the following: /usr/lib/libipq.a /usr/include/libipq.h /usr/share/man/man3/libipq.3.gz I tried to compile like this. g++ -o ipqtest iptables.cpp -lipq <<--- Fails to compile. g++ -o ipqtest iptables.cpp /usr/lib/libipq.a gcc -o ipqtest iptables.c -lipq <-- Compiles!! I get the following error when i compile with g++. But when i change my file name iptables.cpp to iptables.c and compile, it compiles without any problems!! Symbol list of libipq.a is: libipq.o: U bind U close U __errno_location U fprintf U fputc U fputs U free U fwrite U getpid 00000260 T ipq_create_handle 00000550 T ipq_ctl 000003a0 T ipq_destroy_handle 00000000 D ipq_errmap 00000000 b ipq_errno 00000560 T ipq_errstr 00000460 T ipq_get_msgerr 00000470 T ipq_get_packet 00000450 T ipq_message_type 00000090 t ipq_netlink_recvfrom 00000050 t ipq_netlink_sendmsg 00000000 t ipq_netlink_sendto 00000580 T ipq_perror 00000440 T ipq_read 000003d0 T ipq_set_mode 00000480 T ipq_set_verdict 00000240 t ipq_strerror U malloc U recvfrom U select U sendmsg U sendto U socket U stderr U strerror Error while compiling. /tmp/ccEVoYgQ.o(.text+0xf): In function `die(ipq_handle*)': : undefined reference to `ipq_perror(char const*)' /tmp/ccEVoYgQ.o(.text+0x1d): In function `die(ipq_handle*)': : undefined reference to `ipq_destroy_handle(ipq_handle*)' /tmp/ccEVoYgQ.o(.text+0x37): In function `mains(int, char**)': : undefined reference to `ipq_create_handle(unsigned, unsigned)' /tmp/ccEVoYgQ.o(.text+0x6f): In function `mains(int, char**)': : undefined reference to `ipq_set_mode(ipq_handle const*, unsigned char, unsigned)' /tmp/ccEVoYgQ.o(.text+0xa6): In function `mains(int, char**)': : undefined reference to `ipq_read(ipq_handle const*, unsigned char*, unsigned, int)' /tmp/ccEVoYgQ.o(.text+0xd2): In function `mains(int, char**)': : undefined reference to `ipq_message_type(unsigned char const*)' /tmp/ccEVoYgQ.o(.text+0x104): In function `mains(int, char**)': : undefined reference to `ipq_get_msgerr(unsigned char const*)' /tmp/ccEVoYgQ.o(.text+0x12f): In function `mains(int, char**)': : undefined reference to `ipq_get_packet(unsigned char const*)' /tmp/ccEVoYgQ.o(.text+0x154): In function `mains(int, char**)': : undefined reference to `ipq_set_verdict(ipq_handle const*, unsigned, unsigned, unsigned, unsigned char*)' collect2: ld returned 1 exit status Any help would be highly appreciated. Thanks, L.Suresh From eljay@adobe.com Tue Aug 31 12:18:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 31 Aug 2004 12:18:00 -0000 Subject: Link problems in g++ but not in gcc!! In-Reply-To: <1093952856.5304.18.camel@Ironwing> References: <1093952856.5304.18.camel@Ironwing> Message-ID: <6.1.2.0.2.20040831070257.01f81858@iplan-mn.corp.adobe.com> Hi L.Suresh, It appears that the libipq.a is a C ABI library, but the header file(s) for libipq.a are not specified as using the C ABI when compiled with C++. For example, if you look at one of the those header files (I'm guessing "ipq.h") does it have this near the top (AFTER any included header files in the ipq.h): #ifdef __cplusplus extern "C" { #endif ...and this near the bottom... #ifdef __cplusplus } #endif If it doesn't have those C++ guards, then to include the C++-ignorant C header file, you should do this in your iptables.cpp file (I'm just making them up off the top of my head): #include "iptable.h" extern "C" { #include "ipq.h" } #include #include #include Or what I've seen developers do is make a ipq.hpp file that only contains this: extern "C" { #include "ipq.h" } Then your C++ code doesn't look so polluted, and just contains this: #include "iptable.h" #include "ipq.hpp" #include #include #include HTH, --Eljay From eljay@adobe.com Tue Aug 31 12:18:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 31 Aug 2004 12:18:00 -0000 Subject: function calls before variable declarations does not give error in gcc? In-Reply-To: <3aa41a650408302210d03ca6d@mail.gmail.com> References: <3aa41a650408302022774d7486@mail.gmail.com> <6.1.2.0.2.20040830225651.01f46e20@iplan-mn.corp.adobe.com> <3aa41a650408302210d03ca6d@mail.gmail.com> Message-ID: <6.1.2.0.2.20040831070032.02027ec0@iplan-mn.corp.adobe.com> Hi Oza, You're running into a GNU extension to C89, and a standard part of C99. $ gcc -pedantic -std=c99 -W -Wall -Wno-unused-variable c99.c No error messages. $ gcc -pedantic -std=c89 -W -Wall -Wno-unused-variable c99.c c99.c: In function `main': c99.c:11: warning: ISO C89 forbids mixed declarations and code Error messages. HTH, --Eljay From hfpmehtetlxm@yahoo.com Tue Aug 31 14:12:00 2004 From: hfpmehtetlxm@yahoo.com (Robby Mcintyre) Date: Tue, 31 Aug 2004 14:12:00 -0000 Subject: Fw: bore Message-ID: I just received this today, take a look would you? http://www.downloadsaver.com/ref44.html You can just about download any CD album you want to. Not to mention console games and dvd's. I've already downloaded 8 console games and music CD's.. Be sure and let me know once you've seen it - you're going to flip. Theres an area that teaches you how to burn the stuff to CD. I saw a few areas of the movie section, and found titles in there still in theaters - it's nutty. Tell me when you get back. Young From eljay@adobe.com Tue Aug 31 20:35:00 2004 From: eljay@adobe.com (Eljay Love-Jensen) Date: Tue, 31 Aug 2004 20:35:00 -0000 Subject: Link problems in g++ but not in gcc!! In-Reply-To: <6.1.2.0.2.20040831070257.01f81858@iplan-mn.corp.adobe.com> References: <1093952856.5304.18.camel@Ironwing> <6.1.2.0.2.20040831070257.01f81858@iplan-mn.corp.adobe.com> Message-ID: <6.1.2.0.2.20040831071219.0429e008@iplan-mn.corp.adobe.com> Hi L.Suresh, CAVEAT! If you make an "ipq.hpp" header file that only contains this... extern "C" { #include "ipq.h" } ...that's just fine if ipq.h does not, itself, include any header files. But if it does include any header files, your ipq.hpp should include those header files first. And you should use the same guard that ipq.h uses -- but don't DEFINE it, just trigger off of it. #ifndef ipq_h_once #include "alpha.h" #include extern "C" { #include "ipq.h" } #endif You don't want to compromise those other header files by extern "C"-ing them. If the made-up "alpha.h" is, itself, in the same boat, then do this... #ifndef ipq_h_once #include "alpha.hpp" // "C" wrapper around alpha.h #include extern "C" { #include "ipq.h" } #endif It can turn into a mighty be can-o'-worms if there are lots and lots of header files. Might be easier to instrument (edit) the C header files with the... #ifdef __cplusplus extern "C" { #endif HTH, --Eljay From bdubbs@swbell.net Tue Aug 31 20:58:00 2004 From: bdubbs@swbell.net (Bruce Dubbs) Date: Tue, 31 Aug 2004 20:58:00 -0000 Subject: Building gcc-3.4.1 Ada In-Reply-To: <41340B2E.6030206@swbell.net> References: <41340B2E.6030206@swbell.net> Message-ID: <4134873A.2000900@swbell.net> Bruce Dubbs wrote: > I'm having quite a problem building Ada with 3.4.1. I set up and run > configure and make bootstrap fine, but I can never get the > gnatlibs_and_tools target to show up in the Makefile, so the > documented process of > > cd gcc > make gnatlibs_and_tools > > fails. > > I am using an Ada enabled base compiler and gnatbind, gnat, gnatls, > etc are built. I'm not that familiar with Ada, so I'm not sure if > everything that is supposed to be built is now done in the make > bootstrap phase or not. Sorry to follow up my own post, but I was wrong in the post above, the only files that are created are gnat1 and gnatbind. I was looking at the make install text and made some incorrect assumptions. The process I am using does work for gcc-3.3.3. I'm stumped. -- Bruce From learning_c@hotmail.com Tue Aug 31 22:06:00 2004 From: learning_c@hotmail.com (learning c++) Date: Tue, 31 Aug 2004 22:06:00 -0000 Subject: String and Char in function template Message-ID: Hi, Everyone: I have a short code about function template like this: #include #include using std::cout; template // template parameter list T const &greater(T const &first, T const &second) { return (first > second) ? first : second; } int main() { int a = 1, b = 2; cout << greater(a, b) << '\n'; long c = 4L, d = 3L; cout << greater(c, d) << '\n'; double e = 5.62, f = 3.48; cout << greater(e, f) << '\n'; char g = 'A', h = 'a'; cout << greater(g, h) << '\n'; std::string two("two"), three("three"); cout << greater(two, three) << '\n'; char const *two("two"), *three("three"); cout << greater(two, three) << '\n'; char const *two("two"), *three("three"); cout << greater(two, three) << '\n'; return 0; } when I compile it, the errors are the following: /v/dunix51_alpha/gnu/gcc/lib/gcc-lib/alphaev5-dec-osf5/3.3/include/c++/bits/stl_function.h: In function `int main()': /v/dunix51_alpha/gnu/gcc/lib/gcc-lib/alphaev5-dec-osf5/3.3/include/c++/bits/stl_function.h:188: error: ` template struct std::greater' is not a function, greater.cpp:7: error: conflict with `template const T& greater(const T&, const T&)' greater.cpp:22: error: in call to `greater' greater.cpp:23: error: conflicting types for `const char*two' greater.cpp:21: error: previous declaration as `std::string two' greater.cpp:23: error: conflicting types for `const char*three' greater.cpp:21: error: previous declaration as `std::string three' greater.cpp:23: warning: statement with no effect greater.cpp:23: confused by earlier errors, bailing out What is wrong with my code? In addition, I hope to know something about "const" in "char const *two("two"), *three("three");" and the difference between "using std::cout;" and "using namespace std;" Thanks in advance! _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail