Search Results

Search found 2303 results on 93 pages for 'llvm gcc'.

Page 10/93 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Where are the static methods in gcc's dump file.c.135r.jump

    - by Customizer
    When I run gcc with the parameter -fdump-rtl-jump, I get a dump file with the name file.c.135r.jump, where I can read some information about the intermediate representation of the methods in my C or C++ file. I just recently discovered, that the static methods of a project are missing in this dump file. Do you know, why they are missing in that representation and if there is a possibility to include the static methods in this file, too. Update (some additional information): The test program, I'm using here, is the Hybrid OpenMP MPI Benchmark. Update2: I just reproduced the problem with a serial application, so it has nothing to do with parallel sections.

    Read the article

  • Illegal instruction gcc assembler.

    - by Bernt
    In assembler: .globl _test _test: pushl %ebp movl %esp, %ebp movl $0, %eax pushl %eax popl %ebp ret Calling from c main() { _test(); } Compile: gcc -m32 -o test test.c test.s This code gives me illegal instruction sometimes and segment fault other times. In gdc i always get illegal instruction, this is just a simple test, i had a larger program that was working and suddenly after no apperant reason stopped working, now i always get this error even if i start from scratch like above. I have narrowed it down to pushl %eax (or any other register....), if i comment out that line the code runs fine. Any ideas? (I'm running the program at my universities linux cluster, so I have not changed any settings..)

    Read the article

  • x86 gcc assembly output help please

    - by rayfinkle
    Pasted below is unoptimized GCC assembly output for "int main(){}". I'm relatively good with x86 assembly, but some of this is unfamiliar. Could someone please do a line-by-line walk-through of what's going on here? Thanks! .text .globl _main _main: LFB2: pushq %rbp LCFI0: movq %rsp, %rbp LCFI1: leave ret LFE2: .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support EH_frame1: .set L$set$0,LECIE1-LSCIE1 .long L$set$0 LSCIE1: .long 0x0 .byte 0x1 .ascii "zR\0" .byte 0x1 .byte 0x78 .byte 0x10 .byte 0x1 .byte 0x10 .byte 0xc .byte 0x7 .byte 0x8 .byte 0x90 .byte 0x1 .align 3 LECIE1: .globl _main.eh _main.eh: LSFDE1: .set L$set$1,LEFDE1-LASFDE1 .long L$set$1 LASFDE1: .long LASFDE1-EH_frame1 .quad LFB2-. .set L$set$2,LFE2-LFB2 .quad L$set$2 .byte 0x0 .byte 0x4 .set L$set$3,LCFI0-LFB2 .long L$set$3 .byte 0xe .byte 0x10 .byte 0x86 .byte 0x2 .byte 0x4 .set L$set$4,LCFI1-LCFI0 .long L$set$4 .byte 0xd .byte 0x6 .align 3 LEFDE1: .subsections_via_symbols

    Read the article

  • Cygwin GCC + WinXP cmd.exe does nothing

    - by Stephen Friederichs
    My basic problem is that if I run GCC from the windows command line (cmd.exe in Windows XP) and it does nothing: no .o files are created, no error messages, nothing. It will only throw an error message if I use DOS-style paths, but nothing else. When I run from the Cygwin shell then it will throws error messages as appropriate for the errors in the source and produces the .o files as it needs. Using 'make' from the DOS command line doesn't work either. Has anyone encountered this behavior before?

    Read the article

  • how to link static library into dynamic library in gcc

    - by bob
    Under gcc (g++), I have compiled a static .a (call it some_static_lib.a) library. I want to link (is that the right phrase?) this .a file into another dynamic library (call it libsomeDyn.so) that I'm building. Though the .so compiles, I don't see content of .a under .so using nm command: /usr/bin/g++ -fPIC -g -O2 -Wall -Werror -pipe -march=pentium3 -mtune=prescott -MD -D_FILE_OFFSET_BITS=64 -DLINUX -D_GNU_SOURCE -D_THREAD_SAFE -DUSE_STD_YUTSTRING -DNO_FACTORY -I../../../../../../../../ -I../../../../../../../..//libraries -Wl,-rpath,/usr/lib -o libsomeDyn.so some.o another.o some_static_lib.a -shared -Wl -x -Wl,-soname,libsomeDyn.so I do not see functions under some_static_lib.a under libsomeDyn.so. What am I doing wrong?

    Read the article

  • Data-only static libraries with GCC

    - by regularfry
    How can I make static libraries with only binary data, that is without any object code, and make that data available to a C program? Here's the build process and simplified code I'm trying to make work: ./datafile: abcdefghij Makefile: libdatafile.a: ar [magic] datafile main: libdatafile.a gcc main.c libdatafile.a -o main main.c: #define TEXTPTR [more magic] int main(){ char mystring[11]; memset(mystring, '\0', 11); memcpy(TEXTPTR, mystring, 10); puts(mystring); puts(mystring); return 0; } The output I'm expecting from running main is, of course: abcdefghijabcdefghij My question is: what should [magic] and [more magic] be?

    Read the article

  • [GCC, linking] How to link app with static library + why this is not working

    - by user278799
    I have a problem. I wrote example code and I want to build it without the error: main.cpp.text+0x5): undefined reference to `test()' Library test1.c #include <stdlib.h> void test() { puts("Dziala"); } test1.h #ifndef TEST1_H #define TEST1_H extern void test(); #endif makefile all: gcc -c ./src/test1.c -o ./lib/test1.o ar rcs ./lib/libtest1.a ./lib/test1.o Program main.cpp #include <test1.h> int main() { test(); return 0; } makefile all: g++ -static -I../test1/include -L../test1/lib ./src/main.cpp -o ./build/MyApp -ltest1 What am I doing wrong?

    Read the article

  • memory alignment within gcc structs

    - by Mumbles
    I am porting an application to an ARM platform in C, the application also runs on an x86 processor, and must be backward compatible. I am now having some issues with variable alignment. I have read the gcc manual for __attribute__((aligned(4),packed)) I interpret what is being said as the start of the struct is aligned to the 4 byte boundry and the inside remains untouched because of the packed statement. originally I had this but occasionally it gets placed unaligned with the 4 byte boundary. typedef struct { unsigned int code; unsigned int length; unsigned int seq; unsigned int request; unsigned char nonce[16]; unsigned short crc; } __attribute__((packed)) CHALLENGE; so I change it to this. typedef struct { unsigned int code; unsigned int length; unsigned int seq; unsigned int request; unsigned char nonce[16]; unsigned short crc; } __attribute__((aligned(4),packed)) CHALLENGE; The understand I stated earlier seems to be incorrect as both the struct is now aligned to a 4 byte boundary, and and the inside data is now aligned to a four byte boundary, but because of the endianess, the size of the struct has increased in size from 42 to 44 bytes. This size is critical as we have other applications that depend on the struct being 42 bytes. Could some describe to me how to perform the operation that I require. Any help is much appreciated.

    Read the article

  • gcc -finline-functions behaviour?

    - by user176168
    I'm using gcc with the -finline-functions optimization for release builds. In order to combat code bloat because I work on an embedded system I want to say don't inline particular functions. The obvious way to do this would be through function attributes ie attribute(noinline). The problem is this doesn't seem to work when I switch on the global -finline-functions optimisation which is part of the -O3 switch. It also has something to do with it being templated as a non templated version of the same function doesn't get inlined which is as expected. Has anybody any idea of how to control inlining when this global switch is on? Here's the code: #include <cstdlib> #include <iostream> using namespace std; class Base { public: template<typename _Type_> static _Type_ fooT( _Type_ x, _Type_ y ) __attribute__ (( noinline )); }; template<typename _Type_> _Type_ Base::fooT( _Type_ x, _Type_ y ) { asm(""); return x + y; } int main(int argc, char *argv[]) { int test = Base::fooT( 1, 2 ); printf( "test = %d\n", test ); system("PAUSE"); return EXIT_SUCCESS; }

    Read the article

  • SSE (SIMD extensions) support in gcc

    - by goldenmean
    Hi, I see a code as below: include "stdio.h" #define VECTOR_SIZE 4 typedef float v4sf __attribute__ ((vector_size(sizeof(float)*VECTOR_SIZE))); // vector of four single floats typedef union f4vector { v4sf v; float f[VECTOR_SIZE]; } f4vector; void print_vector (f4vector *v) { printf("%f,%f,%f,%f\n", v->f[0], v->f[1], v->f[2], v->f[3]); } int main() { union f4vector a, b, c; a.v = (v4sf){1.2, 2.3, 3.4, 4.5}; b.v = (v4sf){5., 6., 7., 8.}; c.v = a.v + b.v; print_vector(&a); print_vector(&b); print_vector(&c); } This code builds fine and works expectedly using gcc (it's inbuild SSE / MMX extensions and vector data types. this code is doing a SIMD vector addition using 4 single floats. I want to understand in detail what does each keyword/function call on this typedef line means and does: typedef float v4sf __attribute__ ((vector_size(sizeof(float)*VECTOR_SIZE))); What is the vector_size() function return; What is the __attribute__ keyword for Here is the float data type being type defined to vfsf type? I understand the rest part. thanks, -AD

    Read the article

  • std::stringstream GCC Abnormal Behavior

    - by FlorianZ
    I have a very interesting problem with compiling a short little program on a Mac (GCC 4.2). The function below would only stream chars or strings into the stringstream, but not anything else (int, double, float, etc.) In fact, the fail flag is set if I attempt to convert for example an int into a string. However, removing the preprocessor flag: _GLIBCXX_DEBUG=1, which is set by default in XCode for the debug mode, will yield the desired results / correct behavior. Here is the simple function I am talking about. value is template variable of type T. Tested for int, double, float (not working), char and strings (working). template < typename T > const std::string Attribute<T>::getValueAsString() const { std::ostringstream stringValue; stringValue << value; return stringValue.str(); } Any ideas what I am doing wrong, why this doesn't work, or what the preprocessor flag does to make this not work anymore? Thanks!

    Read the article

  • How to catch unintentional function interpositioning with GCC?

    - by SiegeX
    Reading through my book Expert C Programming, I came across the chapter on function interpositioning and how it can lead to some serious hard to find bugs if done unintentionally. The example given in the book is the following: my_source.c mktemp() { ... } main() { mktemp(); getwd(); } libc mktemp(){ ... } getwd(){ ...; mktemp(); ... } According to the book, what happens in main() is that mktemp() (a standard C library function) is interposed by the implementation in my_source.c. Although having main() call my implementation of mktemp() is intended behavior, having getwd() (another C library function) also call my implementation of mktemp() is not. Apparently, this example was a real life bug that existed in SunOS 4.0.3's version of lpr. The book goes on to explain the fix was to add the keyword static to the definition of mktemp() in my_source.c; although changing the name altogether should have fixed this problem as well. This chapter leaves me with some unresolved questions that I hope you guys could answer: Should our software group adopt the practice of putting the keyword static in front of all functions that we don't want to be exposed? Does GCC have a way to warn about function interposition? We certainly don't ever intend on this happening and I'd like to know about it if it does. Can interposition happen with functions introduced by static libraries? Thanks for the help.

    Read the article

  • gcc precompiled headers weird behaviour with -c option

    - by pachanga
    Folks, I'm using gcc-4.4.1 on Linux and before trying precompiled headers in a really large project I decided to test them on simple program. They "kinda work" but I'm not happy with results and I'm sure there is something wrong about my setup. First of all, I wrote a simple program(main.cpp) to test if they work at all: #include <boost/bind.hpp> #include <boost/function.hpp> #include <boost/type_traits.hpp> int main() { return 0; } Then I created the precompiled headers file pre.h(in the same directory) as follows: #include <boost/bind.hpp> #include <boost/function.hpp> #include <boost/type_traits.hpp> ...and compiled it: $ g++ -I. pre.h (pre.h.gch was created) After that I measured compile time with and without precompiled headers: with pch $ time g++ -I. -include pre.h main.cpp real 0m0.128s user 0m0.088s sys 0m0.048s without pch $ time g++ -I. main.cpp real 0m0.838s user 0m0.784s sys 0m0.056s So far so good! Almost 7 times faster, that's impressive! Now let's try something more realistic. All my sources are built with -c option and for some reason I can't make pch play nicely with it. You can reproduce this with the following steps below... I created the test module foo.cpp as follows: #include <boost/bind.hpp> #include <boost/function.hpp> #include <boost/type_traits.hpp> int whatever() { return 0; } Here are the timings of my attempts to build the module foo.cpp with and without pch: with pch $ time g++ -I. -include pre.h -c foo.cpp real 0m0.357s user 0m0.348s sys 0m0.012s without pch $ time g++ -I. -c foo.cpp real 0m0.330s user 0m0.292s sys 0m0.044s That's quite strange, looks like there is no speed up at all!(I ran timings for several times). It turned out precompiled headers were not used at all in this case, I checked it with -H option(output of "g++ -I. -include pre.h -c foo.cpp -H" didn't list pre.h.gch at all). What am I doing wrong?

    Read the article

  • gcc/g++: error when compiling large file

    - by Alexander
    Hi, I have a auto-generated C++ source file, around 40 MB in size. It largely consists of push_back commands for some vectors and string constants that shall be pushed. When I try to compile this file, g++ exits and says that it couldn't reserve enough virtual memory (around 3 GB). Googling this problem, I found that using the command line switches --param ggc-min-expand=0 --param ggc-min-heapsize=4096 may solve the problem. They, however, only seem to work when optimization is turned on. 1) Is this really the solution that I am looking for? 2) Or is there a faster, better (compiling takes ages with these options acitvated) way to do this? Best wishes, Alexander Update: Thanks for all the good ideas. I tried most of them. Using an array instead of several push_back() operations reduced memory usage, but as the file that I was trying to compile was so big, it still crashed, only later. In a way, this behaviour is really interesting, as there is not much to optimize in such a setting -- what does the GCC do behind the scenes that costs so much memory? (I compiled with deactivating all optimizations as well and got the same results) The solution that I switched to now is reading in the original data from a binary object file that I created from the original file using objcopy. This is what I originally did not want to do, because creating the data structures in a higher-level language (in this case Perl) was more convenient than having to do this in C++. However, getting this running under Win32 was more complicated than expected. objcopy seems to generate files in the ELF format, and it seems that some of the problems I had disappeared when I manually set the output format to pe-i386. The symbols in the object file are by standard named after the file name, e.g. converting the file inbuilt_training_data.bin would result in these two symbols: binary_inbuilt_training_data_bin_start and binary_inbuilt_training_data_bin_end. I found some tutorials on the web which claim that these symbols should be declared as extern char _binary_inbuilt_training_data_bin_start;, but this does not seem to be right -- only extern char binary_inbuilt_training_data_bin_start; worked for me.

    Read the article

  • Make mex compiler of matlab working on mint?

    - by Erogol
    Mex compiler of matlab does not work with following error Warning: You are using gcc version "4.7.2-2ubuntu1)". The version currently supported with MEX is "4.4.6". For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release/ /home/krm/matlab/bin/mex: 1: eval: g++: not found mex: compile of ' "fv_cache/fv_cache.cc"' failed. it is obvious that I need preceding version of gcc but this specific version is not included in software manager of mint. I installed gcc-4.4 but it does not recognized by Matlab. I also removed latest version from my computer and set gcc as a environment variable points to gcc-4.4 but again does not work. Is there any other way around to solve that issue? Maybe a interface or something.

    Read the article

  • Conflicting PACKAGE_NAME and other macros when using autotools.

    - by baol
    When using autotools (with a config.h file) for both a library and a software built on that library the compiler complains about a redefinition of some macros (PACKAGE_NAME, PACKAGE_TARNAME and so on). How can I prevent this? The config.h file is needed in the library to propagate it's setting to the software that use it. Right now I have a wrapper script library_config.h that includes the original config.h and provides defaults when the user is not using autotools, but even undefining the macros in that package I get the redefinition warning from gcc. #ifndef LIB_CONFIG_H #define LIB_CONFIG_H #ifdef HAVE_CONFIG_H # include "config.h" # undef PACKAGE # undef PACKAGE_BUGREPORT # undef PACKAGE_NAME # undef PACKAGE_STRING # undef PACKAGE_TARNAME # undef PACKAGE_VERSION # undef VERSION #else # if defined (WIN32) # define HAVE_UNORDERED_MAP 1 # define TR1_MIXED_NAMESPACE 1 # elif defined (__GXX_EXPERIMENTAL_CXX0X__) # define HAVE_UNORDERED_MAP 1 # else # define HAVE_TR1_UNORDERED_MAP 1 # endif #endif #endif I believe the best option would be to have a library without that macros: How can I avoid the definition of PACKAGE, PACKAGE_NAME and so on in the library when using autotools?

    Read the article

  • How to build LLVM using GCC 4 on Windows?

    - by Steve314
    I have been able to build LLVM 2.6 (the llvm-2.6.tar.gz package) using MinGW GCC 3.4.5. I haven't tested properly, but it seems to work. The trouble is, I have libraries of my own which don't build using GCC3, but which work fine in GCC4 (template issues). I believe the first official GCC4 version for MinGW is GCC 4.4.0. EDIT Decluttered - everything useful in the "tried this tried that" info is now in the answer. EDIT Most of this question/answer is redundant with LLVM 2.7 - the standard configure, make routine works fine in MinGW with no hacks or workarounds.

    Read the article

  • How to compile using gcc but without using _alloca ?

    - by shkim
    For some reason, I should use gcc to compile a C file, then link against Visual C++ 2008 project. (I used the current latest gcc version: cygwin gcc 4.3.4 20090804.) But there is one problem: gcc always allocate a big array with _alloca, and VC linker can't resolve the symbol __alloca. for example, int func() { int big[10240]; .... } this code makes the _alloca dependency although I didn't call the _alloca function explicitly. (array size matters. if i change 10240 - 128, everything ok) I tried gcc option -fno-builtin-alloca or -fno-builtin, but no luck. Is it possible to make gcc not to use _alloca ? (or adjust the threshold?)

    Read the article

  • Mac gcc non-virtual thunk error

    - by fret
    I'm getting these non-virtual thunk errors only in the Deployment build of my app. It uses a private framework called Lgi. Building on 10.5.8 using XCode 3.1.4 (latest for leopard?) The error looks like this: Ld /Users/matthew/Code/Scribe-Branches/v2.00/build/Development/Scribe.app/Contents/MacOS/Scribe normal i386 cd /Users/matthew/Code/Scribe-Branches/v2.00 /Developer/usr/bin/g++-4.0 -arch i386 -L/Users/matthew/Code/Scribe-Branches/v2.00/build/Development -F/Users/matthew/Code/Scribe-Branches/v2.00/build/Development -F/Users/matthew/Code/Lgi/build -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Development -F/Users/matthew/Code/Scribe-Branches/v2.00/../../Lgi/build/Deployment -filelist /Users/matthew/Code/Scribe-Branches/v2.00/build/Scribe.build/Development/Scribe.build/Objects-normal/i386/Scribe.LinkFileList -framework Carbon -framework Lgi -o /Users/matthew/Code/Scribe-Branches/v2.00/build/Development/Scribe.app/Contents/MacOS/Scribe Undefined symbols: "non-virtual thunk to GWindow::OnDrop(char*, GVariant*, GdcPt2, int)", referenced from: vtable for ScribeWndin ScribeApp.o vtable for GShutdownin ScribeApp.o vtable for CalendarUiin Calendar.o vtable for CalendarViewWndin CalendarView.o vtable for CalendarConfigin CalendarView.o vtable for ScribeExportin Exp_Scribe.o vtable for GNewMailDlgin GNewMailDlg.o ....etc for lots of classes.... Anyway I know I'm not leaving those undefined because it does in fact link and run fine in the development build. Now after googling the issue the first thing to try is changing the optimization setting, which I did... and no dice. Some link error. So these virtual functions are initially defined in GDragDropTarget, and GWindow's inheritance looks like this: class LgiClass GWindow : public GView #ifndef WIN32 , public GDragDropTarget #endif (LgiClass being for __declspec export/import on win32) Any ideas on what to try next? Maybe I need to provide more info.

    Read the article

  • XCode GCC-4.0 vs 4.2

    - by John Smith
    I have just changed a compiler option from 4.0 to 4.2. Now I get an error: jump to case label crosses initialization of 'const char* selectorName' It works fine in 4.0 Any ideas?

    Read the article

  • GCC 4.2 Build error

    - by Mr. Man
    Hi, i am building a C project with Xcode and when ever i build it it gives me this error: ld: duplicate symbol _detectLinux in /Users/markszymanski/Desktop/Programming/C/iTermOS/build/iTermOS.build/Debug/iTermOS.build/Objects-normal/i386/linuxDetect.o and /Users/markszymanski/Desktop/Programming/C/iTermOS/build/iTermOS.build/Debug/iTermOS.build/Objects-normal/i386/iTermOS.o Thanks!

    Read the article

  • gcc returns error with nested class

    - by Nate
    Howdy, I am attempting to use the fully qualified name of my nested class as below, but the compiler is balking! template <class T> class Apple { //constructors, members, whatevers, etc... public: class Banana { public: Banana() { //etc... } //other constructors, members, etc... }; }; template <class K> class Carrot{ public: //etc... void problemFunction() { Apple<int>::Banana freshBanana = someVar.returnsABanana(); //line 85 giveMonkey(freshBanana); //line 86 } }; My issue is, the compiler says: Carrot.h:85: error: expected ';' before 'freshBanana' Carrot.h:86: error: 'freshBanana' was not declared in this scope I had thought that using the fully qualified name permitted me to access this nested class? It's probably going to smack me in the face, but what on earth am I not seeing here??

    Read the article

  • GCC emits extra code for boost::shared_ptr dereference

    - by Checkers
    I have the following code: #include <boost/shared_ptr.hpp> struct Foo { int a; }; static int A; void func_shared(const boost::shared_ptr<Foo> &foo) { A = foo->a; } void func_raw(Foo * const foo) { A = foo->a; } I thought the compiler would create identical code, but for shared_ptr version an extra seemingly redundant instruction is emitted. Disassembly of section .text: 00000000 <func_raw(Foo*)>: 0: 55 push ebp 1: 89 e5 mov ebp,esp 3: 8b 45 08 mov eax,DWORD PTR [ebp+8] 6: 5d pop ebp 7: 8b 00 mov eax,DWORD PTR [eax] 9: a3 00 00 00 00 mov ds:0x0,eax e: c3 ret f: 90 nop 00000010 <func_shared(boost::shared_ptr<Foo> const&)>: 10: 55 push ebp 11: 89 e5 mov ebp,esp 13: 8b 45 08 mov eax,DWORD PTR [ebp+8] 16: 5d pop ebp 17: 8b 00 mov eax,DWORD PTR [eax] 19: 8b 00 mov eax,DWORD PTR [eax] 1b: a3 00 00 00 00 mov ds:0x0,eax 20: c3 ret I'm just curious, is this necessary, or it is just an optimizer's shortcoming? Compiling with g++ 4.1.2, -O3 -NDEBUG.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >