[Dnsmasq-discuss] Compile time error - prctl

Simon Kelley simon at thekelleys.org.uk
Sun Jan 13 12:36:44 GMT 2013


On 12/01/13 16:38, Daniele wrote:
> Hi there,
> I'm trying to compile dnsmasq for my router running mipsel+busybox (it's
> an AR7 based box). I'm compiling under Ubuntu 12 and the toolchain
> should be working fine since I succesfully compiled other programs.
> Compiling works file for all the components (cache.c, util.c, etc..) but
> the process stops at this stage
>
> mipsel-uclibc-gcc  -o dnsmasq cache.o rfc1035.o util.o option.o
> forward.o network.o dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o
> bpf.o helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o dhcp-common.o
> outpacket.o radv.o slaac.o
>
> With the following error:
> dnsmasq.o: In function `main':
> dnsmasq.c:(.text+0x235c): undefined reference to `prctl'
> dnsmasq.c:(.text+0x3b14): undefined reference to `prctl'
>
> I investigated a bit, and found this thread
> http://comments.gmane.org/gmane.network.dns.dnsmasq.general/1162
>
> so I dumbly entered the code, commented the two prctl calls and
> succesfully compiled.
>
> The binary looks to be working so far, but I'd like to understand a bit
> more what I'm missing by having commented those calls.

One of the calls is not going to give you a problem - it just turns on 
core dumps in debug mode. The other one might - it's part of the process 
of drop most root privileges but keeping just enough capabilities to 
work. If you have problems then running with user=root will fix them, at 
the expense of notionally less security.

>
> second point: with uclibc, I get binary around 200 kB. Are there any
> tricks to make it lighter at compile time? ie, I don't use DNS
> functionalities, just DHCP.. is there any possiblity to disable the
> compilation of the DNS modules?
DNS is the one thing that you can't omit, but there is a load of modules 
you can. see src/config.h for details. DHCP6, TFTP and SCRIPT are 
obvious ones to go for.


Cheers,

Simon.

>
> thanks
> daniele
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>




More information about the Dnsmasq-discuss mailing list