tsgates / rust.ko

A minimal Linux kernel module written in rust.
896 stars 66 forks source link

ld: unrecognized option '--require-defined=...' #18

Closed tbelaire closed 8 years ago

tbelaire commented 8 years ago

Hi, I'm really excited about the newest patch, with bindgen support, but I'm getting errors when compiling it.

ld -m elf_x86_64   --gc-sections --entry=init_module --require-defined=cleanup_module  -r -o /home/tbelaire/Code/rust.ko/build/hello.o /home/tbelaire/Code/rust.ko/build/src/module.o /home/tbelaire/Code/rust.ko/build/libhello.a 
ld: unrecognized option '--require-defined=cleanup_module'

$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

My binutils package is up to date, should I be using a llvm linker or something?

Oh, and I needed to add in

 "-fno-delete-null-pointer-checks",

to the CLANG_ARGS_BLACKLIST, but that's fine.

cuviper commented 8 years ago

It appears --require-defined is a new option in binutils 2.26: ld/NEWS

tbelaire commented 8 years ago

I don't know how to install the newer version of binutils.

sudo apt-get install binutils=2.26

fails.

Is there a way to not pass this flag?

bluet commented 8 years ago

@tbelaire try my PR, it works on my Ubuntu 14.04.