This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Build malloc.c shared object?


how2 build malloc.c shared object?  Please help....

$ cd glibc-2.7/malloc
$ gcc -O3 -g -fno-stack-protector -shared -ldl -o malloc.so malloc.c

malloc.c:254:28: error: malloc-machine.h: No such file or directory
malloc.c:1584: error: expected ')' before 'size_t'
malloc.c:1585: error: expected ')' before 'void'
malloc.c:1586: error: expected ')' before 'void'
malloc.c:1587: error: expected ')' before 'size_t'
malloc.c:1588: error: expected ')' before 'size_t'
malloc.c:1589: error: expected ')' before 'size_t'
malloc.c:1592: error: expected ')' before 'size_t'
malloc.c:1593: error: expected ')' before 'size_t'
malloc.c:1599: warning: parameter names (without types) in function declaration
malloc.c:2319: error: expected specifier-qualifier-list before 'mutex_t'
malloc.c:2408: error: expected ')' before 'av'
malloc.c:2438: error: expected declaration specifiers or '...' before 'mstate'
malloc.c:2439: error: expected declaration specifiers or '...' before 'mstate'
malloc.c:2440: warning: parameter names (without types) in function declaration
malloc.c:2442: error: expected ')' before 'size_t'
In file included from malloc.c:2506:
arena.c:60: error: expected specifier-qualifier-list before 'mstate'
arena.c:79: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'arena_key'
arena.c:80: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'list_lock'
arena.c: In function 'malloc_atfork':
arena.c:177: error: 'arena_key' undeclared (first use in this function)
arena.c:177: error: (Each undeclared identifier is reported only once
arena.c:177: error: for each function it appears in.)
arena.c:181: warning: return makes pointer from integer without a cast
arena.c:185: warning: assignment makes pointer from integer without a cast
arena.c:192: error: 'list_lock' undeclared (first use in this function)
arena.c: In function 'free_atfork':
arena.c:202: error: 'mstate' undeclared (first use in this function)
arena.c:202: error: expected ';' before 'ar_ptr'
arena.c:218: error: 'ar_ptr' undeclared (first use in this function)
arena.c:218: error: 'heap_info' has no member named 'ar_ptr'
arena.c:219: error: 'arena_key' undeclared (first use in this function)
arena.c: In function 'ptmalloc_lock_all':
arena.c:240: error: 'mstate' undeclared (first use in this function)
arena.c:240: error: expected ';' before 'ar_ptr'
arena.c:244: error: 'list_lock' undeclared (first use in this function)
arena.c:247: error: 'arena_key' undeclared (first use in this function)
arena.c:256: error: 'ar_ptr' undeclared (first use in this function)
arena.c: In function 'ptmalloc_unlock_all':
arena.c:275: error: 'mstate' undeclared (first use in this function)
arena.c:275: error: expected ';' before 'ar_ptr'
arena.c:281: error: 'arena_key' undeclared (first use in this function)
arena.c:284: error: 'ar_ptr' undeclared (first use in this function)
arena.c:289: error: 'list_lock' undeclared (first use in this function)
arena.c: In function 'ptmalloc_unlock_all2':
arena.c:302: error: 'mstate' undeclared (first use in this function)
arena.c:302: error: expected ';' before 'ar_ptr'
arena.c:311: error: 'ar_ptr' undeclared (first use in this function)
arena.c:316: error: 'list_lock' undeclared (first use in this function)
arena.c: In function 'ptmalloc_init':
arena.c:465: error: 'struct malloc_state' has no member named 'mutex'
arena.c:466: error: 'struct malloc_state' has no member named 'next'
arena.c:480: error: 'list_lock' undeclared (first use in this function)
arena.c:481: error: 'arena_key' undeclared (first use in this function)
arena.c: In function 'new_heap':
arena.c:697: error: 'heap_info' has no member named 'size'
arena.c:698: error: 'heap_info' has no member named 'mprotect_size'
arena.c: In function 'grow_heap':
arena.c:718: error: 'heap_info' has no member named 'size'
arena.c:721: error: 'heap_info' has no member named 'mprotect_size'
arena.c:722: error: 'heap_info' has no member named 'mprotect_size'
arena.c:723: error: 'heap_info' has no member named 'mprotect_size'
arena.c:726: error: 'heap_info' has no member named 'mprotect_size'
arena.c:729: error: 'heap_info' has no member named 'size'
arena.c:743: error: 'heap_info' has no member named 'mprotect_size'
arena.c:751: error: 'heap_info' has no member named 'size'
arena.c: In function 'heap_trim':
arena.c:772: error: 'mstate' undeclared (first use in this function)
arena.c:772: error: expected ';' before 'ar_ptr'
arena.c:774: error: 'ar_ptr' undeclared (first use in this function)
arena.c:780: error: 'heap_info' has no member named 'prev'
arena.c:781: error: 'heap_info' has no member named 'size'
arena.c:789: error: 'heap_info' has no member named 'size'
arena.c:791: error: 'heap_info' has no member named 'size'
arena.c:792: error: 'heap_info' has no member named 'size'
arena.c: At top level:
arena.c:824: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '_int_new_arena'
arena.c:866: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'arena_get2'
In file included from malloc.c:2893:
hooks.c: In function 'mem2chunk_check':
hooks.c:160: error: 'struct malloc_state' has no member named 'flags'
hooks.c:164: error: 'struct malloc_state' has no member named 'system_mem'
hooks.c: In function 'top_check':
hooks.c:211: error: 'struct malloc_state' has no member named 'top'
hooks.c:216: error: 'struct malloc_state' has no member named 'bins'
hooks.c:220: error: 'struct malloc_state' has no member named 'flags'
hooks.c:221: error: 'struct malloc_state' has no member named 'system_mem'
hooks.c:242: error: 'struct malloc_state' has no member named 'system_mem'
hooks.c:244: error: 'struct malloc_state' has no member named 'top'
hooks.c:245: error: 'struct malloc_state' has no member named 'top'
hooks.c: In function 'malloc_check':
hooks.c:264: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:265: warning: pointer/integer type mismatch in conditional expression
hooks.c:266: error: 'struct malloc_state' has no member named 'mutex'
hooks.c: In function 'free_check':
hooks.c:280: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:283: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:290: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:299: error: 'struct malloc_state' has no member named 'mutex'
hooks.c: In function 'realloc_check':
hooks.c:324: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:326: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:334: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:351: warning: assignment makes pointer from integer without a cast
hooks.c:361: warning: assignment makes pointer from integer without a cast
hooks.c:383: error: 'struct malloc_state' has no member named 'mutex'
hooks.c: In function 'memalign_check':
hooks.c:407: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:409: warning: pointer/integer type mismatch in conditional expression
hooks.c:410: error: 'struct malloc_state' has no member named 'mutex'
hooks.c: In function 'malloc_starter':
hooks.c:439: warning: assignment makes pointer from integer without a cast
hooks.c: In function 'memalign_starter':
hooks.c:453: warning: assignment makes pointer from integer without a cast
hooks.c: In function 'malloc_get_state':
hooks.c:531: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:537: error: 'struct malloc_state' has no member named 'top'
hooks.c:540: error: 'struct malloc_state' has no member named 'bins'
hooks.c:549: error: 'struct malloc_state' has no member named 'system_mem'
hooks.c:555: error: 'struct malloc_state' has no member named 'max_system_mem'
hooks.c:566: error: 'struct malloc_state' has no member named 'mutex'
hooks.c: In function 'malloc_set_state':
hooks.c:582: error: 'struct malloc_state' has no member named 'mutex'
hooks.c:584: error: 'struct malloc_state' has no member named 'flags'
hooks.c:587: error: 'struct malloc_state' has no member named 'fastbins'
hooks.c:589: error: 'struct malloc_state' has no member named 'binmap'
hooks.c:590: error: 'struct malloc_state' has no member named 'top'
hooks.c:591: error: 'struct malloc_state' has no member named 'last_remainder'
hooks.c:593: error: 'struct malloc_state' has no member named 'bins'
hooks.c:607: error: 'struct malloc_state' has no member named 'binmap'
hooks.c:612: error: 'struct malloc_state' has no member named 'bins'
hooks.c:622: error: 'struct malloc_state' has no member named 'bins'
hooks.c:623: error: 'struct malloc_state' has no member named 'bins'
hooks.c:632: error: 'struct malloc_state' has no member named 'system_mem'
hooks.c:638: error: 'struct malloc_state' has no member named 'max_system_mem'
hooks.c:663: error: 'struct malloc_state' has no member named 'mutex'
malloc.c: At top level:
malloc.c:2906: error: expected declaration specifiers or '...' before 'mstate'
malloc.c: In function 'sYSMALLOc':
malloc.c:3023: error: 'av' undeclared (first use in this function)
malloc.c:3053: error: 'heap_info' has no member named 'size'
malloc.c:3056: error: 'heap_info' has no member named 'size'
malloc.c:3057: error: 'heap_info' has no member named 'size'
malloc.c:3062: error: 'heap_info' has no member named 'size'
malloc.c:3067: error: 'heap_info' has no member named 'ar_ptr'
malloc.c:3068: error: 'heap_info' has no member named 'prev'
malloc.c:3069: error: 'heap_info' has no member named 'size'
malloc.c:3070: error: 'heap_info' has no member named 'size'
malloc.c:3077: error: 'heap_info' has no member named 'size'
malloc.c: At top level:
malloc.c:3381: error: expected declaration specifiers or '...' before 'mstate'
malloc.c: In function 'sYSTRIm':
malloc.c:3394: error: 'av' undeclared (first use in this function)
malloc.c: In function 'mremap_chunk':
malloc.c:3511: error: 'MREMAP_MAYMOVE' undeclared (first use in this function)
malloc.c: In function 'malloc':
malloc.c:3543: error: 'mstate' undeclared (first use in this function)
malloc.c:3543: error: expected ';' before 'ar_ptr'
malloc.c:3550: error: 'ar_ptr' undeclared (first use in this function)
malloc.c:3550: error: expected ';' before 'tsd_getspecific'
malloc.c:3553: warning: assignment makes pointer from integer without a cast
malloc.c:3558: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:3559: warning: assignment makes pointer from integer without a cast
malloc.c:3560: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:3565: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:3567: warning: assignment makes pointer from integer without a cast
malloc.c: In function 'free':
malloc.c:3585: error: 'mstate' undeclared (first use in this function)
malloc.c:3585: error: expected ';' before 'ar_ptr'
malloc.c:3615: error: 'ar_ptr' undeclared (first use in this function)
malloc.c:3615: error: 'heap_info' has no member named 'ar_ptr'
malloc.c: In function 'realloc':
malloc.c:3636: error: 'mstate' undeclared (first use in this function)
malloc.c:3636: error: expected ';' before 'ar_ptr'
malloc.c:3692: error: 'ar_ptr' undeclared (first use in this function)
malloc.c:3692: error: 'heap_info' has no member named 'ar_ptr'
malloc.c:3706: error: 'arena_key' undeclared (first use in this function)
malloc.c:3709: warning: assignment makes pointer from integer without a cast
malloc.c: In function 'memalign':
malloc.c:3746: error: 'mstate' undeclared (first use in this function)
malloc.c:3746: error: expected ';' before 'ar_ptr'
malloc.c:3761: error: 'ar_ptr' undeclared (first use in this function)
malloc.c:3761: error: expected ';' before 'tsd_getspecific'
malloc.c:3764: warning: assignment makes pointer from integer without a cast
malloc.c:3769: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:3770: warning: assignment makes pointer from integer without a cast
malloc.c:3771: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:3777: warning: assignment makes pointer from integer without a cast
malloc.c: In function 'valloc':
malloc.c:3794: error: 'mstate' undeclared (first use in this function)
malloc.c:3794: error: expected ';' before 'ar_ptr'
malloc.c:3806: error: 'ar_ptr' undeclared (first use in this function)
malloc.c:3806: error: expected ';' before 'tsd_getspecific'
malloc.c:3809: warning: assignment makes pointer from integer without a cast
malloc.c: In function 'pvalloc':
malloc.c:3817: error: 'mstate' undeclared (first use in this function)
malloc.c:3817: error: expected ';' before 'ar_ptr'
malloc.c:3831: error: 'ar_ptr' undeclared (first use in this function)
malloc.c:3831: error: expected ';' before 'tsd_getspecific'
malloc.c:3832: warning: assignment makes pointer from integer without a cast
malloc.c: In function 'calloc':
malloc.c:3840: error: 'mstate' undeclared (first use in this function)
malloc.c:3840: error: expected ';' before 'av'
malloc.c:3876: error: 'av' undeclared (first use in this function)
malloc.c:3876: error: expected ';' before 'tsd_getspecific'
malloc.c:3892: warning: assignment makes pointer from integer without a cast
malloc.c:3903: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:3904: warning: assignment makes pointer from integer without a cast
malloc.c:3905: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:3909: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:3911: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:3913: warning: assignment makes pointer from integer without a cast
malloc.c: In function 'independent_calloc':
malloc.c:3978: error: 'mstate' undeclared (first use in this function)
malloc.c:3978: error: expected ';' before 'ar_ptr'
malloc.c:3981: error: 'ar_ptr' undeclared (first use in this function)
malloc.c:3981: error: expected ';' before 'tsd_getspecific'
malloc.c:3985: warning: assignment makes pointer from integer without a cast
malloc.c: In function 'independent_comalloc':
malloc.c:3993: error: 'mstate' undeclared (first use in this function)
malloc.c:3993: error: expected ';' before 'ar_ptr'
malloc.c:3996: error: 'ar_ptr' undeclared (first use in this function)
malloc.c:3996: error: expected ';' before 'tsd_getspecific'
malloc.c:4000: warning: assignment makes pointer from integer without a cast
malloc.c: In function 'malloc_trim':
malloc.c:4020: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:4022: error: 'struct malloc_state' has no member named 'mutex'
malloc.c: In function 'mallinfo':
malloc.c:4047: error: 'struct malloc_state' has no member named 'mutex'
malloc.c:4049: error: 'struct malloc_state' has no member named 'mutex'
malloc.c: At top level:
malloc.c:4066: error: expected ')' before 'av'
malloc.c:4530: error: expected ')' before 'av'
malloc.c:4768: error: expected ')' before 'av'
malloc.c:4883: error: expected ')' before 'av'
malloc.c:5122: error: expected ')' before 'av'
malloc.c:5290: error: expected ')' before 'av'
malloc.c:5307: error: expected ')' before 'av'
malloc.c:5330: error: expected ')' before 'av'
malloc.c:5456: error: expected ')' before 'av'
malloc.c:5473: error: expected ')' before 'av'
malloc.c: In function 'mTRIm':
malloc.c:5497: error: 'mstate' undeclared (first use in this function)
malloc.c:5497: error: expected ';' before 'av'
malloc.c:5500: error: 'av' undeclared (first use in this function)
malloc.c:5503: error: too many arguments to function 'sYSTRIm'
malloc.c: At top level:
malloc.c:5535: error: expected ')' before 'av'
malloc.c: In function 'mSTATs':
malloc.c:5597: error: 'mstate' undeclared (first use in this function)
malloc.c:5597: error: expected ';' before 'ar_ptr'
malloc.c:5611: error: 'ar_ptr' undeclared (first use in this function)
malloc.c: In function 'mALLOPt':
malloc.c:5672: error: 'mstate' undeclared (first use in this function)
malloc.c:5672: error: expected ';' before 'av'
malloc.c:5677: error: 'av' undeclared (first use in this function)
malloc.c: At top level:
malloc.c:5875: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'attribute_hidden'
malloc.c: In function 'malloc_printerr':
malloc.c:5887: warning: initialization makes pointer from integer without a cast
malloc.c:5893: error: '__libc_argv' undeclared (first use in this function)


I want 2 LD_PRELOAD=./malloc.so


Thx,
Sam


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]