All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] __attribute_used__ error on 2.6.23.9
@ 2007-12-26 22:26 Quantum Skyline
  2007-12-27  0:42 ` Jeff Dike
  0 siblings, 1 reply; 5+ messages in thread
From: Quantum Skyline @ 2007-12-26 22:26 UTC (permalink / raw)
  To: user-mode-linux-devel

Hi,

I've been trying to modify the UML makefiles in the 2.6.23.9 kernel to 
compile against a different C library, but I'm running into trouble 
getting parts of UML to compile with GCC 4.2.1.  In particular, files in 
os-Linux that use functions like __uml_setup are causing GCC to throw 
errors.

For example, when I try to compile arch/um/os-Linux/aio.c in my 
environment, I get the following:

gcc-4.2.1-rev -Wp,-MD,arch/um/os-Linux/.aio.o.d  -Wall -Wundef 
-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common 
-Werror-implicit-function-declaration -Os -D__arch_um__ 
-DSUBARCH=\"i386\" -Dvmap=kernel_vmap 
-Din6addr_loopback=kernel_in6addr_loopback 
-Din6addr_any=kernel_in6addr_any -march=i686 
-mpreferred-stack-boundary=2 -ffreestanding -D_LARGEFILE64_SOURCE 
-fno-unit-at-a-time -fno-omit-frame-pointer -fno-optimize-sibling-calls 
-g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign 
-Iarch/um/include 
-I/home/tmjackso/build/orchestra/uml/linux-2.6.23.9/arch/um/include/skas 
-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE 
-DHAVE_AIO_ABI -v -nostdinc -I../../dietlibc/trunk/include -isystem 
/usr/local/gcc-4.2.1-rev/include -c -o arch/um/os-Linux/aio.o 
arch/um/os-Linux/aio.c
arch/um/os-Linux/aio.c:307: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘__attribute_used__’
arch/um/os-Linux/aio.c:307: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘__attribute_used__’
arch/um/os-Linux/aio.c:350: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘__attribute_used__’
arch/um/os-Linux/aio.c:360: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘__attribute_used__’

I know that __uml_setup and friends are defined in 
arch/um/include/init.h and it is being included, but it seems like GCC 
is not using it.  If I comment out __uml_setup, other files which have 
functions starting with two underscores like __uml_initcall also cause 
compilation to fail.

Can anyone give some hints to solve this problem?

Cheers,

Todd Jackson

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [uml-devel] __attribute_used__ error on 2.6.23.9
  2007-12-26 22:26 [uml-devel] __attribute_used__ error on 2.6.23.9 Quantum Skyline
@ 2007-12-27  0:42 ` Jeff Dike
  2007-12-27  2:30   ` Todd Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Dike @ 2007-12-27  0:42 UTC (permalink / raw)
  To: Quantum Skyline; +Cc: user-mode-linux-devel

On Wed, Dec 26, 2007 at 02:26:09PM -0800, Quantum Skyline wrote:
> Hi,
> 
> I've been trying to modify the UML makefiles in the 2.6.23.9 kernel to 
> compile against a different C library, but I'm running into trouble 
> getting parts of UML to compile with GCC 4.2.1.  In particular, files in 
> os-Linux that use functions like __uml_setup are causing GCC to throw 
> errors.
> 
> For example, when I try to compile arch/um/os-Linux/aio.c in my 
> environment, I get the following:
> 
> gcc-4.2.1-rev -Wp,-MD,arch/um/os-Linux/.aio.o.d  -Wall -Wundef 
> -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common 
> -Werror-implicit-function-declaration -Os -D__arch_um__ 
> -DSUBARCH=\"i386\" -Dvmap=kernel_vmap 
> -Din6addr_loopback=kernel_in6addr_loopback 
> -Din6addr_any=kernel_in6addr_any -march=i686 
> I know that __uml_setup and friends are defined in 
> arch/um/include/init.h and it is being included, but it seems like GCC 
> is not using it.  If I comment out __uml_setup, other files which have 
> functions starting with two underscores like __uml_initcall also cause 
> compilation to fail.
> 
> Can anyone give some hints to solve this problem?

Probably you need the patch below.

				Jeff

-- 
Work email - jdike at linux dot intel dot com

From: Jeff Dike <jdike@addtoit.com>

init.h started breaking now for some reason.  It turns out that there wasn't a
definition of __used.  Fixed this by copying the relevant stuff from
compiler.h in the userspace case, and including compiler.h in the kernel case.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/um/include/init.h |    9 +++++++++
 1 file changed, 9 insertions(+)

diff -puN arch/um/include/init.h~uml-arch-um-include-inith-needs-a-definition-of-__used arch/um/include/init.h
--- a/arch/um/include/init.h~uml-arch-um-include-inith-needs-a-definition-of-__used
+++ a/arch/um/include/init.h
@@ -40,6 +40,15 @@
 typedef int (*initcall_t)(void);
 typedef void (*exitcall_t)(void);
 
+#ifndef __KERNEL__
+#if __GNUC_MINOR__ >= 3
+# define __used			__attribute__((__used__))
+#else
+# define __used			__attribute__((__unused__))
+#endif
+#else
+#include <linux/compiler.h>
+#endif
 /* These are for everybody (although not all archs will actually
    discard it in modules) */
 #define __init		__attribute__ ((__section__ (".init.text")))
_

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [uml-devel] __attribute_used__ error on 2.6.23.9
  2007-12-27  0:42 ` Jeff Dike
@ 2007-12-27  2:30   ` Todd Jackson
  2007-12-27  2:58     ` Jeff Dike
  2008-01-02 15:37     ` Jeff Dike
  0 siblings, 2 replies; 5+ messages in thread
From: Todd Jackson @ 2007-12-27  2:30 UTC (permalink / raw)
  To: Jeff Dike; +Cc: user-mode-linux-devel

Jeff Dike wrote:
> On Wed, Dec 26, 2007 at 02:26:09PM -0800, Quantum Skyline wrote:
>> Hi,
>>
>> I've been trying to modify the UML makefiles in the 2.6.23.9 kernel to 
>> compile against a different C library, but I'm running into trouble 
>> getting parts of UML to compile with GCC 4.2.1.  In particular, files in 
>> os-Linux that use functions like __uml_setup are causing GCC to throw 
>> errors.
>>
>> For example, when I try to compile arch/um/os-Linux/aio.c in my 
>> environment, I get the following:
>>
>> gcc-4.2.1-rev -Wp,-MD,arch/um/os-Linux/.aio.o.d  -Wall -Wundef 
>> -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common 
>> -Werror-implicit-function-declaration -Os -D__arch_um__ 
>> -DSUBARCH=\"i386\" -Dvmap=kernel_vmap 
>> -Din6addr_loopback=kernel_in6addr_loopback 
>> -Din6addr_any=kernel_in6addr_any -march=i686 
>> I know that __uml_setup and friends are defined in 
>> arch/um/include/init.h and it is being included, but it seems like GCC 
>> is not using it.  If I comment out __uml_setup, other files which have 
>> functions starting with two underscores like __uml_initcall also cause 
>> compilation to fail.
>>
>> Can anyone give some hints to solve this problem?
> 
> Probably you need the patch below.
> 
> 				Jeff
> 


Hi Jeff,

That patch didn't work...I'm still seeing the same error with the patch 
applied.

Is there anything glibc-specific that UML depends on?

Cheers,

Todd

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [uml-devel] __attribute_used__ error on 2.6.23.9
  2007-12-27  2:30   ` Todd Jackson
@ 2007-12-27  2:58     ` Jeff Dike
  2008-01-02 15:37     ` Jeff Dike
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Dike @ 2007-12-27  2:58 UTC (permalink / raw)
  To: Todd Jackson; +Cc: user-mode-linux-devel

On Wed, Dec 26, 2007 at 06:30:34PM -0800, Todd Jackson wrote:
> That patch didn't work...I'm still seeing the same error with the patch 
> applied.

I would double-check that the patch is applied - I swear I saw some
similar error which that fixed.

> Is there anything glibc-specific that UML depends on?

Not that I know of.

You're seeing a syntax error, so just make arch/um/os-Linux/aio.i,
eyeball the result, and see what the used stuff is expanding into.
That should give you an idea what needs to be done.

				Jeff

-- 
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [uml-devel] __attribute_used__ error on 2.6.23.9
  2007-12-27  2:30   ` Todd Jackson
  2007-12-27  2:58     ` Jeff Dike
@ 2008-01-02 15:37     ` Jeff Dike
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Dike @ 2008-01-02 15:37 UTC (permalink / raw)
  To: Todd Jackson; +Cc: user-mode-linux-devel

On Wed, Dec 26, 2007 at 06:30:34PM -0800, Todd Jackson wrote:
> That patch didn't work...I'm still seeing the same error with the patch 
> applied.

Can you make aio.i and send it to me?

				Jeff

-- 
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-02 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-26 22:26 [uml-devel] __attribute_used__ error on 2.6.23.9 Quantum Skyline
2007-12-27  0:42 ` Jeff Dike
2007-12-27  2:30   ` Todd Jackson
2007-12-27  2:58     ` Jeff Dike
2008-01-02 15:37     ` Jeff Dike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.