Re: [lm-sensors] i2c tools build failure with gcc 4.6

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

 



On Fri, Dec 21, 2012 at 09:45:41AM +0100, Jean Delvare wrote:
> Hi Guenter,
> 
> On Thu, 20 Dec 2012 08:39:45 -0800, Guenter Roeck wrote:
> > I found the problem. -li2c must be specified after the .o files.
> > 
> > Patch:
> > 
> > diff --git a/tools/Module.mk b/tools/Module.mk
> > index 1979248..bfd3250 100644
> > --- a/tools/Module.mk
> > +++ b/tools/Module.mk
> > @@ -21,16 +21,16 @@ TOOLS_TARGETS	:= i2cdetect i2cdump i2cset i2cget
> >  #
> >  
> >  $(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o
> > -	$(CC) $(LDFLAGS) $(TOOLS_LDFLAGS) -o $@ $^
> > +	$(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
> >  
> >  $(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
> > -	$(CC) $(LDFLAGS) $(TOOLS_LDFLAGS) -o $@ $^
> > +	$(CC) $(LDFLAGS) -o $@ $^  $(TOOLS_LDFLAGS)
> >  
> >  $(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
> > -	$(CC) $(LDFLAGS) $(TOOLS_LDFLAGS) -o $@ $^
> > +	$(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
> >  
> >  $(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
> > -	$(CC) $(LDFLAGS) $(TOOLS_LDFLAGS) -o $@ $^
> > +	$(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
> >  
> >  #
> >  # Objects
> 
> Hmm, OK. The gcc manual page is somewhat confusing on this topic but as
> I understand it, when processing a library, it only considers symbols
> which were already referenced but not defined, and discards the rest.
> So object files must indeed come first on the command line.
> 
> Why it has always worked for me the other way around is a mystery.
> 
Something must have changed, since it works for me with an older version of gcc
(4.4).

> You have write permissions to the repository, so please just commit
> this fix, thanks.
> 
Done.

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux