Skip to contentSkip to conversation

Cross compiling : problem linking

DISCUSSION Wolfgang Denk 1 participant 1 message Oct 2, 2003 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 7 lines · In message <1065104646.13376.8.camel@toni> you wrote:
Quoted 4 lines

Without more information (i. e. what sort of code this is and how you intend it to run - stdandalone, in kernel or in user context) nobody can help you.

Final goal is a kernel module, but now I'm writing a test program in user space (standalone, dynamic compiled).

These are two completely different issues.

Quoted 8 lines

Code is quite simple (but I'm unsure about the correctness, due to the fact that my C knowledge has collapsed since I didn't use it anymore last 2 years):

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <asm/io.h>

You're including a kernel header file here. You must not do this. The functions / macros you're looking for are not available in user space (for example, outb is #defined only when __KERNEL__ is defined which is never the case for user space applications.)

Quoted 1 line

So somewhere, there is a linker problem.

No, it's a misunderstanding on your side. You cannot run kernel code in user space or vice versa.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] I have yet to add the ESP-driver to the kernel to read the mind of
the user... - Linus Torvalds in

      <[email protected]>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/