Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] how to compile a C program without main() ?



You can find the "nocache" script (wich preloads the library) here:

http://git.debian.org/?p=users/enrico/nocache.git;a=tree;h=refs/heads/master;hb=refs/heads/master

    Pier

On Thu, May 12, 2011 at 15:57, Gernot Hassenpflug <aikishugyo@example.com> wrote:
> Dear all,
>
> I'm not sure how best to word the subject, as I am not sure what I should be
> looking to solve here.
>
> I found this preload library (nocache) source code
>
> http://enricozini.org/2010/tips/nocache/
>
> and want to test it on a server running CentOS4.8 with kernel 2.6.9-89.EL to
> see if it reduces RAM usage when doing backups with tar (apparently, it
> would be run as "nocache tar .....".
> However, I have been unable to link the program, only compile the object
> code.
>
> During the Googling/looking for solutions, I made one addition to the code
> at the start of the defines. I added the line:
>
> #define _GNU_SOURCE
>
> since the RTLD_NEXT symbols are now extensions and not in the normal dlcfn.h
> header file.
>
> So then I could successfully obtain the object code:
> $ gcc -Wall -c nocache.c
> $
>
> To link I needed to link the "dl" library also, but still, I get an error
> owing to lack of main():
>
> $ gcc -Wall -ldl -o nocache nocache.o
> /usr/lib/gcc/i386-redhat-
> linux/3.4.6/../../../crt1.o(.text+0x18): In function `_start':
> : undefined reference to `main'
> collect2: ld returned 1 exit status
> $
>
> Any pointers most appreciated.
> Best regards,
> Gernot Hassenpflug
>
> --
> To unsubscribe from this mailing list,
> please see the instructions at http://lists.tlug.jp/list.html
>
> The TLUG mailing list is hosted by the award-winning Internet provider
> ASAHI Net.
> Visit ASAHI Net's English-language Web page: http://asahi-net.jp/en/
>


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links