* i2c tools build failure with gcc 4.6
@ 2012-12-20 1:07 Guenter Roeck
[not found] ` <20121220010733.GA31336-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2012-12-20 1:07 UTC (permalink / raw)
To: Jean Delvare
Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA
Seen with latest i2c-tools from svn repository.
gcc 4.6:
gcc-4.6 -Llib -li2c -o tools/i2cdetect tools/i2cdetect.o tools/i2cbusses.o
tools/i2cdetect.o: In function `main':
i2cdetect.c:(.text.startup+0x557): undefined reference to `i2c_smbus_write_quick'
i2cdetect.c:(.text.startup+0x5e9): undefined reference to `i2c_smbus_read_byte'
collect2: ld returned 1 exit status
make: *** [tools/i2cdetect] Error 1
gcc-4.4:
gcc-4.4 -Llib -li2c -o tools/i2cdetect tools/i2cdetect.o tools/i2cbusses.o
[ no error ]
Any idea ?
Guenter
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: i2c tools build failure with gcc 4.6
[not found] ` <20121220010733.GA31336-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2012-12-20 9:45 ` Jean Delvare
[not found] ` <20121220104510.2fa8a0fb-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Jean Delvare @ 2012-12-20 9:45 UTC (permalink / raw)
To: Guenter Roeck
Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA
Hi Guenter,
On Wed, 19 Dec 2012 17:07:33 -0800, Guenter Roeck wrote:
> Seen with latest i2c-tools from svn repository.
With the subversion repository having gone on vacation, "latest"
doesn't mean much :(
> gcc 4.6:
>
> gcc-4.6 -Llib -li2c -o tools/i2cdetect tools/i2cdetect.o tools/i2cbusses.o
> tools/i2cdetect.o: In function `main':
> i2cdetect.c:(.text.startup+0x557): undefined reference to `i2c_smbus_write_quick'
> i2cdetect.c:(.text.startup+0x5e9): undefined reference to `i2c_smbus_read_byte'
> collect2: ld returned 1 exit status
> make: *** [tools/i2cdetect] Error 1
>
> gcc-4.4:
> gcc-4.4 -Llib -li2c -o tools/i2cdetect tools/i2cdetect.o tools/i2cbusses.o
>
> [ no error ]
>
> Any idea ?
I'm using gcc 4.6.2 (from openSUSE 12.1) and "the latest
i2c-tools" (that would be from October 25th if I can trust the CHANGES
timestamp) builds just fine for me. OTOH this is a linking problem, not
building problem, so the version of "ld" may be more relevant. Are you
using the same version of "ld" in both cases?
The error messages suggest that gcc (and subsequently ld) doesn't find
the symbols exported by libi2c. I can't figure out any reason why it
would be so. Can you show us the output of "nm lib/libi2c.so.0.1.0"?
This is what I get here:
0000000000201e30 a _DYNAMIC
0000000000201fe8 a _GLOBAL_OFFSET_TABLE_
w _Jv_RegisterClasses
0000000000201e10 d __CTOR_END__
0000000000201e08 d __CTOR_LIST__
0000000000201e20 d __DTOR_END__
0000000000201e18 d __DTOR_LIST__
0000000000000f10 r __FRAME_END__
0000000000201e28 d __JCR_END__
0000000000201e28 d __JCR_LIST__
0000000000202028 a __bss_start
w __cxa_finalize@@GLIBC_2.2.5
0000000000000c90 t __do_global_ctors_aux
0000000000000850 t __do_global_dtors_aux
0000000000202020 d __dso_handle
U __errno_location@@GLIBC_2.2.5
w __gmon_start__
0000000000202028 a _edata
0000000000202038 a _end
0000000000000cc8 t _fini
00000000000007c8 t _init
0000000000000cd8 t _real_fini
0000000000000830 t call_gmon_start
0000000000202028 b completed.5890
0000000000202030 b dtor_idx.5892
00000000000008d0 t frame_dummy
0000000000000900 T i2c_smbus_access
0000000000000c00 T i2c_smbus_block_process_call
0000000000000a40 T i2c_smbus_process_call
0000000000000a70 T i2c_smbus_read_block_data
0000000000000950 T i2c_smbus_read_byte
00000000000009a0 T i2c_smbus_read_byte_data
0000000000000b30 T i2c_smbus_read_i2c_block_data
00000000000009f0 T i2c_smbus_read_word_data
0000000000000ad0 T i2c_smbus_write_block_data
0000000000000980 T i2c_smbus_write_byte
00000000000009d0 T i2c_smbus_write_byte_data
0000000000000ba0 T i2c_smbus_write_i2c_block_data
0000000000000940 T i2c_smbus_write_quick
0000000000000a20 T i2c_smbus_write_word_data
U ioctl@@GLIBC_2.2.5
This could also be a Makefile dependency issue... I can't remember
what, if anything, guarantees that the library is built before the
tools which use it.
--
Jean Delvare
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: i2c tools build failure with gcc 4.6
[not found] ` <20121220104510.2fa8a0fb-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-12-20 14:20 ` Guenter Roeck
[not found] ` <20121220142006.GB32230-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2012-12-20 14:20 UTC (permalink / raw)
To: Jean Delvare
Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Thu, Dec 20, 2012 at 10:45:10AM +0100, Jean Delvare wrote:
> Hi Guenter,
>
> On Wed, 19 Dec 2012 17:07:33 -0800, Guenter Roeck wrote:
> > Seen with latest i2c-tools from svn repository.
>
> With the subversion repository having gone on vacation, "latest"
> doesn't mean much :(
>
Oh, right, "the latest one I have", which is svn revision 6075. Is that the
latest ?
> > gcc 4.6:
> >
> > gcc-4.6 -Llib -li2c -o tools/i2cdetect tools/i2cdetect.o tools/i2cbusses.o
> > tools/i2cdetect.o: In function `main':
> > i2cdetect.c:(.text.startup+0x557): undefined reference to `i2c_smbus_write_quick'
> > i2cdetect.c:(.text.startup+0x5e9): undefined reference to `i2c_smbus_read_byte'
> > collect2: ld returned 1 exit status
> > make: *** [tools/i2cdetect] Error 1
> >
> > gcc-4.4:
> > gcc-4.4 -Llib -li2c -o tools/i2cdetect tools/i2cdetect.o tools/i2cbusses.o
> >
> > [ no error ]
> >
> > Any idea ?
>
> I'm using gcc 4.6.2 (from openSUSE 12.1) and "the latest
> i2c-tools" (that would be from October 25th if I can trust the CHANGES
> timestamp) builds just fine for me. OTOH this is a linking problem, not
> building problem, so the version of "ld" may be more relevant. Are you
> using the same version of "ld" in both cases?
>
> The error messages suggest that gcc (and subsequently ld) doesn't find
> the symbols exported by libi2c. I can't figure out any reason why it
> would be so. Can you show us the output of "nm lib/libi2c.so.0.1.0"?
> This is what I get here:
>
> 0000000000201e30 a _DYNAMIC
> 0000000000201fe8 a _GLOBAL_OFFSET_TABLE_
> w _Jv_RegisterClasses
> 0000000000201e10 d __CTOR_END__
> 0000000000201e08 d __CTOR_LIST__
> 0000000000201e20 d __DTOR_END__
> 0000000000201e18 d __DTOR_LIST__
> 0000000000000f10 r __FRAME_END__
> 0000000000201e28 d __JCR_END__
> 0000000000201e28 d __JCR_LIST__
> 0000000000202028 a __bss_start
> w __cxa_finalize@@GLIBC_2.2.5
> 0000000000000c90 t __do_global_ctors_aux
> 0000000000000850 t __do_global_dtors_aux
> 0000000000202020 d __dso_handle
> U __errno_location@@GLIBC_2.2.5
> w __gmon_start__
> 0000000000202028 a _edata
> 0000000000202038 a _end
> 0000000000000cc8 t _fini
> 00000000000007c8 t _init
> 0000000000000cd8 t _real_fini
> 0000000000000830 t call_gmon_start
> 0000000000202028 b completed.5890
> 0000000000202030 b dtor_idx.5892
> 00000000000008d0 t frame_dummy
> 0000000000000900 T i2c_smbus_access
> 0000000000000c00 T i2c_smbus_block_process_call
> 0000000000000a40 T i2c_smbus_process_call
> 0000000000000a70 T i2c_smbus_read_block_data
> 0000000000000950 T i2c_smbus_read_byte
> 00000000000009a0 T i2c_smbus_read_byte_data
> 0000000000000b30 T i2c_smbus_read_i2c_block_data
> 00000000000009f0 T i2c_smbus_read_word_data
> 0000000000000ad0 T i2c_smbus_write_block_data
> 0000000000000980 T i2c_smbus_write_byte
> 00000000000009d0 T i2c_smbus_write_byte_data
> 0000000000000ba0 T i2c_smbus_write_i2c_block_data
> 0000000000000940 T i2c_smbus_write_quick
> 0000000000000a20 T i2c_smbus_write_word_data
> U ioctl@@GLIBC_2.2.5
>
Hmm - I seem to be having the same.
> This could also be a Makefile dependency issue... I can't remember
> what, if anything, guarantees that the library is built before the
> tools which use it.
>
Repeating the command doesn't help, though.
Maybe I am missing some commits ?
Guenter
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: i2c tools build failure with gcc 4.6
[not found] ` <20121220142006.GB32230-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2012-12-20 14:37 ` Jean Delvare
[not found] ` <20121220153735.2ae73802-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Jean Delvare @ 2012-12-20 14:37 UTC (permalink / raw)
To: Guenter Roeck
Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Thu, 20 Dec 2012 06:20:06 -0800, Guenter Roeck wrote:
> On Thu, Dec 20, 2012 at 10:45:10AM +0100, Jean Delvare wrote:
> > Hi Guenter,
> >
> > On Wed, 19 Dec 2012 17:07:33 -0800, Guenter Roeck wrote:
> > > Seen with latest i2c-tools from svn repository.
> >
> > With the subversion repository having gone on vacation, "latest"
> > doesn't mean much :(
> >
> Oh, right, "the latest one I have", which is svn revision 6075. Is that the
> latest ?
"svn status -u" says 6091 but I think this includes the changes to
other trees (lm-sensors.) I have i2c-tools/CHANGES at revision 6083.
> > (...)
> > This could also be a Makefile dependency issue... I can't remember
> > what, if anything, guarantees that the library is built before the
> > tools which use it.
>
> Repeating the command doesn't help, though.
>
> Maybe I am missing some commits ?
The error you get doesn't ring any bell and nothing in CHANGES seems
relevant.
If it helps, I have made my current SVN snapshot available at:
http://khali.linux-fr.org/devel/misc/i2c-tools-SVN.tar.gz
--
Jean Delvare
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: i2c tools build failure with gcc 4.6
[not found] ` <20121220153735.2ae73802-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-12-20 14:44 ` Guenter Roeck
2012-12-20 14:53 ` [lm-sensors] " Jean Delvare
1 sibling, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2012-12-20 14:44 UTC (permalink / raw)
To: Jean Delvare
Cc: lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Thu, Dec 20, 2012 at 03:37:35PM +0100, Jean Delvare wrote:
> On Thu, 20 Dec 2012 06:20:06 -0800, Guenter Roeck wrote:
> > On Thu, Dec 20, 2012 at 10:45:10AM +0100, Jean Delvare wrote:
> > > Hi Guenter,
> > >
> > > On Wed, 19 Dec 2012 17:07:33 -0800, Guenter Roeck wrote:
> > > > Seen with latest i2c-tools from svn repository.
> > >
> > > With the subversion repository having gone on vacation, "latest"
> > > doesn't mean much :(
> > >
> > Oh, right, "the latest one I have", which is svn revision 6075. Is that the
> > latest ?
>
> "svn status -u" says 6091 but I think this includes the changes to
> other trees (lm-sensors.) I have i2c-tools/CHANGES at revision 6083.
>
> > > (...)
> > > This could also be a Makefile dependency issue... I can't remember
> > > what, if anything, guarantees that the library is built before the
> > > tools which use it.
> >
> > Repeating the command doesn't help, though.
> >
> > Maybe I am missing some commits ?
>
> The error you get doesn't ring any bell and nothing in CHANGES seems
> relevant.
>
> If it helps, I have made my current SVN snapshot available at:
> http://khali.linux-fr.org/devel/misc/i2c-tools-SVN.tar.gz
>
I copied it, but get the same result.
My gcc is from Ubuntu. There is some mention of the problem on the web,
on pastebin, so others seem to have the same problem.
Guenter
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [lm-sensors] i2c tools build failure with gcc 4.6
[not found] ` <20121220153735.2ae73802-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-20 14:44 ` Guenter Roeck
@ 2012-12-20 14:53 ` Jean Delvare
[not found] ` <20121220155354.3e600483-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
1 sibling, 1 reply; 10+ messages in thread
From: Jean Delvare @ 2012-12-20 14:53 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
lm-sensors-GZX6beZjE8VD60Wz+7aTrA
On Thu, 20 Dec 2012 15:37:35 +0100, Jean Delvare wrote:
> On Thu, 20 Dec 2012 06:20:06 -0800, Guenter Roeck wrote:
> > On Thu, Dec 20, 2012 at 10:45:10AM +0100, Jean Delvare wrote:
> > > Hi Guenter,
> > >
> > > On Wed, 19 Dec 2012 17:07:33 -0800, Guenter Roeck wrote:
> > > > Seen with latest i2c-tools from svn repository.
> > >
> > > With the subversion repository having gone on vacation, "latest"
> > > doesn't mean much :(
> > >
> > Oh, right, "the latest one I have", which is svn revision 6075. Is that the
> > latest ?
>
> "svn status -u" says 6091 but I think this includes the changes to
> other trees (lm-sensors.) I have i2c-tools/CHANGES at revision 6083.
The SVN repository should be back now, thanks to Axel Thimm.
--
Jean Delvare
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [lm-sensors] i2c tools build failure with gcc 4.6
[not found] ` <20121220155354.3e600483-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-12-20 16:31 ` Guenter Roeck
2012-12-20 16:39 ` Guenter Roeck
1 sibling, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2012-12-20 16:31 UTC (permalink / raw)
To: Jean Delvare
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
lm-sensors-GZX6beZjE8VD60Wz+7aTrA
On Thu, Dec 20, 2012 at 03:53:54PM +0100, Jean Delvare wrote:
> On Thu, 20 Dec 2012 15:37:35 +0100, Jean Delvare wrote:
> > On Thu, 20 Dec 2012 06:20:06 -0800, Guenter Roeck wrote:
> > > On Thu, Dec 20, 2012 at 10:45:10AM +0100, Jean Delvare wrote:
> > > > Hi Guenter,
> > > >
> > > > On Wed, 19 Dec 2012 17:07:33 -0800, Guenter Roeck wrote:
> > > > > Seen with latest i2c-tools from svn repository.
> > > >
> > > > With the subversion repository having gone on vacation, "latest"
> > > > doesn't mean much :(
> > > >
> > > Oh, right, "the latest one I have", which is svn revision 6075. Is that the
> > > latest ?
> >
> > "svn status -u" says 6091 but I think this includes the changes to
> > other trees (lm-sensors.) I have i2c-tools/CHANGES at revision 6083.
>
> The SVN repository should be back now, thanks to Axel Thimm.
>
It is, thanks. No improvement, though; I still get the same error. Trying to
find out what is happening.
Guenter
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [lm-sensors] i2c tools build failure with gcc 4.6
[not found] ` <20121220155354.3e600483-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-20 16:31 ` Guenter Roeck
@ 2012-12-20 16:39 ` Guenter Roeck
[not found] ` <20121220163945.GB32096-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
1 sibling, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2012-12-20 16:39 UTC (permalink / raw)
To: Jean Delvare
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
lm-sensors-GZX6beZjE8VD60Wz+7aTrA
On Thu, Dec 20, 2012 at 03:53:54PM +0100, Jean Delvare wrote:
> On Thu, 20 Dec 2012 15:37:35 +0100, Jean Delvare wrote:
> > On Thu, 20 Dec 2012 06:20:06 -0800, Guenter Roeck wrote:
> > > On Thu, Dec 20, 2012 at 10:45:10AM +0100, Jean Delvare wrote:
> > > > Hi Guenter,
> > > >
> > > > On Wed, 19 Dec 2012 17:07:33 -0800, Guenter Roeck wrote:
> > > > > Seen with latest i2c-tools from svn repository.
> > > >
> > > > With the subversion repository having gone on vacation, "latest"
> > > > doesn't mean much :(
> > > >
> > > Oh, right, "the latest one I have", which is svn revision 6075. Is that the
> > > latest ?
> >
> > "svn status -u" says 6091 but I think this includes the changes to
> > other trees (lm-sensors.) I have i2c-tools/CHANGES at revision 6083.
>
> The SVN repository should be back now, thanks to Axel Thimm.
>
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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [lm-sensors] i2c tools build failure with gcc 4.6
[not found] ` <20121220163945.GB32096-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2012-12-21 8:45 ` Jean Delvare
[not found] ` <20121221094541.5e6125ac-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Jean Delvare @ 2012-12-21 8:45 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
lm-sensors-GZX6beZjE8VD60Wz+7aTrA
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.
You have write permissions to the repository, so please just commit
this fix, thanks.
--
Jean Delvare
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [lm-sensors] i2c tools build failure with gcc 4.6
[not found] ` <20121221094541.5e6125ac-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-12-21 16:45 ` Guenter Roeck
0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2012-12-21 16:45 UTC (permalink / raw)
To: Jean Delvare
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
lm-sensors-GZX6beZjE8VD60Wz+7aTrA
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
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-12-21 16:45 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-20 1:07 i2c tools build failure with gcc 4.6 Guenter Roeck
[not found] ` <20121220010733.GA31336-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2012-12-20 9:45 ` Jean Delvare
[not found] ` <20121220104510.2fa8a0fb-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-20 14:20 ` Guenter Roeck
[not found] ` <20121220142006.GB32230-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2012-12-20 14:37 ` Jean Delvare
[not found] ` <20121220153735.2ae73802-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-20 14:44 ` Guenter Roeck
2012-12-20 14:53 ` [lm-sensors] " Jean Delvare
[not found] ` <20121220155354.3e600483-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-20 16:31 ` Guenter Roeck
2012-12-20 16:39 ` Guenter Roeck
[not found] ` <20121220163945.GB32096-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2012-12-21 8:45 ` Jean Delvare
[not found] ` <20121221094541.5e6125ac-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-21 16:45 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).