Changeset 3c9fc94


Ignore:
Timestamp:
06/03/15 10:23:56 (9 years ago)
Author:
Hal Finkel <hfinkel@…>
Branches:
master
Children:
9f07fa4
Parents:
4c51931
git-author:
Hal Finkel <hfinkel@…> (06/03/15 10:23:56)
git-committer:
Hal Finkel <hfinkel@…> (06/03/15 10:23:56)
Message:

add ld cmds file

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r4598848 r3c9fc94  
    2020install: all memlog_analyze README 
    2121        cp -a libmemlog.so memlog_s.o memlog_analyze README $(DESTDIR)/ 
     22        echo '-Wl,--wrap,malloc,--wrap,valloc,--wrap,realloc,--wrap,calloc,--wrap,memalign,--wrap,free,--wrap,posix_memalign,--wrap,mmap,--wrap,mmap64,--wrap,munmap $(DESTDIR)/memlog_s.o -lpthread -ldl' > $(DESTDIR)/memlog_s_ld_cmds 
    2223 
    2324clean: 
  • README

    red8b809 r3c9fc94  
    1616      -L/path/to/memlog -Wl,-rpath,/path/to/memlog -lmemlog 
    1717 
    18 For statically-linked applications, add the following to your linker flags: 
     18For statically-linked applications ld's automatic wrapping functionality is 
     19employed, and the exact set of necessary flags is large, so a file named 
     20memlog_s_ld_cmds has been provided containing the necessary flags. 
    1921 
    20   -Wl,--wrap,malloc,--wrap,valloc,--wrap,realloc,--wrap,calloc,--wrap,memalign,--wrap,free \ 
    21     -Wl,--wrap,posix_memalign,--wrap,mmap,--wrap,mmap64,--wrap,munmap \ 
    22     /path/to/memlog/memlog_s.o -lpthread -ldl 
     22To your linker flags add: 
     23 
     24  `cat /path/to/memlog/memlog_s_ld_cmds` 
     25 
     26or, if your compiler and wrappers support response files (gcc and clang do, for 
     27example), simply: 
     28 
     29  @/path/to/memlog/memlog_s_ld_cmds 
     30 
     31so your overall linking command might look something like this: 
     32 
     33  mpic++ -O3 -g -o my_program my_obj1.o my_obj2.o @/path/to/memlog/memlog_s_ld_cmds 
    2334 
    2435** RUNNING ** 
Note: See TracChangeset for help on using the changeset viewer.