title: Errors in compiling Linux kernel module: "CONFIG_X86_X32 enabled but no binutils support" and unwanted "n" characters
body: <p>I am trying to get <a href="http://rr0d.droids-corp.org/" rel="noreferrer">Rasta Ring0 Debugger</a> version 0.3 compiled in my x86-64 Linux, it's a Linux kernel module. I have replaced 32-bit inline assembly with 64-bit assembly as explained in my question <a href="https://stackoverflow.com/questions/11897116/how-to-convert-linux-32-bit-gcc-inline-assembly-to-64-bit-code">How to convert Linux 32-bit gcc inline assembly to 64-bit code?</a> , by using Vim regular expressions, and gcc gives no syntax errors. But I get several other errors.</p>
  
  <p>My computer is a Lenovo W520 laptop with Intel Core i7-2760QM and I'm using Debian GNU/Linux Wheezy.</p>
  
  <p>These are first lines of the output of <code>$ make &gt;make_output.txt 2&gt;&amp;1</code></p>
  
  <pre><code>make -C /lib/modules/`uname -r`/build/ SUBDIRS=`pwd` modules
  make[1]: Entering directory `/usr/src/linux-3.5.4'
  /usr/src/linux-3.5.4/arch/x86/Makefile:96: CONFIG_X86_X32 enabled but no binutils support
    CC [M]  /home/user/code/rr0d/0.3/module_nux.o
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/breakpoint.o
  /home/user/code/rr0d/0.3/breakpoint.c: In function ‘insert_bp’:
  /home/user/code/rr0d/0.3/breakpoint.c:66:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  </code></pre>
  
  <p>First, <code>CONFIG_X86_X32 enabled but no binutils support</code>. But in my custom kernel <code>.config</code> it's clear that it's a 64-bit system:</p>
  
  <pre><code>#
  # Automatically generated file; DO NOT EDIT.
  # Linux/x86_64 3.5.4 Kernel Configuration
  #
  CONFIG_64BIT=y
  # CONFIG_X86_32 is not set
  CONFIG_X86_64=y
  CONFIG_X86=y
  CONFIG_INSTRUCTION_DECODER=y
  CONFIG_OUTPUT_FORMAT="elf64-x86-64"
  CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
  </code></pre>
  
  <p>Second, there is this row in <code>$ make &gt;make_output.txt 2&gt;&amp;1</code> output:</p>
  
  <pre><code>/bin/sh: 1: nobjdump: not found
  </code></pre>
  
  <p>Obviously there is no such program as <code>nobjdump</code>, it should be <code>objdump</code>. Where might this <code>n</code> come from? This same error is present later also with <code>ld</code>, in the form of <code>nld</code>. Any ideas where this error might originate and it could be solved?</p>
  
  <p>The <code>Makefile</code> is the following:</p>
  
  <pre><code># EXTRA_CFLAGS +=  -O2 -Wall -DLINUX_26
  EXTRA_CFLAGS +=  -O2 -Wall -DLINUX_26 -m64
  
  OBJ          := module_nux.o breakpoint.o buffering.o command.o disasmbak.o idt.o 
  OBJ          += keyboard.o page.o video.o utils.o import_symb.o core_rr0d.o pci.o
  MODULE       := rr0d.o 
  
  obj-m        := $(MODULE)
  rr0d-objs    := $(OBJ)
  
  default:
      make -C /lib/modules/`uname -r`/build/ SUBDIRS=`pwd` modules
  
  clean:
      rm -f  *.o .*.o.cmd .*.ko.cmd *.mod.c  *~ 
      rm -rf .tmp_versions
  
  mrproper:
      make clean
      rm -f *.ko
  </code></pre>
  
  <p>In <code>Makefile</code> I added <code>-m64</code> to <code>EXTRA_FLAGS</code> but it didn't change the <code>make</code> output.</p>
  
  <p>In the end of output (entire output below) there are three more errors of the same type as the one above:</p>
  
  <pre><code>/bin/sh: 1: nobjdump: not found
  
  /bin/sh: 1: nobjdump: not found
  
  /bin/sh: 1: nld: not found
  </code></pre>
  
  <p>Clearly there are 3 <code>n</code> letters that shouldn't be there. Probably this is not related to Rasta Ring0 Debugger, because I got identical error also when trying to compile <a href="http://pete.akeo.ie/2011/08/writing-linux-device-driver-for-kernels.html" rel="noreferrer">'parrot' sample device driver for Linux 2.6 and 3.0</a>.</p>
  
  <p>So, any ideas how to solve these compiling errors? Googling around for days hasn't helped in this and I'm totally out of ideas.</p>
  
  <p>This is the entire <code>$ make &gt;make_output.txt 2&gt;&amp;1</code> output (including the 8 lines already presented above):</p>
  
  <pre><code>make -C /lib/modules/`uname -r`/build/ SUBDIRS=`pwd` modules
  make[1]: Entering directory `/usr/src/linux-3.5.4'
  /usr/src/linux-3.5.4/arch/x86/Makefile:96: CONFIG_X86_X32 enabled but no binutils support
    CC [M]  /home/user/code/rr0d/0.3/module_nux.o
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/breakpoint.o
  /home/user/code/rr0d/0.3/breakpoint.c: In function ‘insert_bp’:
  /home/user/code/rr0d/0.3/breakpoint.c:66:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/breakpoint.c:74:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/breakpoint.c:80:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/breakpoint.c:81:46: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/breakpoint.c: In function ‘is_breakpoint’:
  /home/user/code/rr0d/0.3/breakpoint.c:127:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/breakpoint.c: In function ‘parse_inst’:
  /home/user/code/rr0d/0.3/breakpoint.c:310:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/breakpoint.c:312:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/breakpoint.c: In function ‘is_hw_breakpoint’:
  /home/user/code/rr0d/0.3/breakpoint.c:600:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/buffering.o
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/command.o
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/disasmbak.o
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/idt.o
  /home/user/code/rr0d/0.3/idt.c: In function ‘translate_logic_to_linear’:
  /home/user/code/rr0d/0.3/idt.c:92:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/idt.c: In function ‘visualise_idt’:
  /home/user/code/rr0d/0.3/idt.c:157:1: warning: the frame size of 2064 bytes is larger than 2048 bytes [-Wframe-larger-than=]
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/keyboard.o
  /home/user/code/rr0d/0.3/keyboard.c: In function ‘back_disasm’:
  /home/user/code/rr0d/0.3/keyboard.c:500:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/keyboard.c:511:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/keyboard.c: In function ‘handle_scancode’:
  /home/user/code/rr0d/0.3/keyboard.c:784:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/keyboard.c:839:55: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/keyboard.c:1230:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/keyboard.c:1245:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/keyboard.c:1250:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/page.o
  /home/user/code/rr0d/0.3/page.c: In function ‘basetp’:
  /home/user/code/rr0d/0.3/page.c:68:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/page.c: In function ‘get_page_info’:
  /home/user/code/rr0d/0.3/page.c:190:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/page.c:193:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/page.c: In function ‘write_save_dirty’:
  /home/user/code/rr0d/0.3/page.c:355:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/page.c:359:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/page.c: In function ‘poked1’:
  /home/user/code/rr0d/0.3/page.c:405:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/page.c:434:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/page.c:447:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/page.c:472:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/video.o
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/utils.o
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/import_symb.o
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/core_rr0d.o
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘printf_disasm’:
  /home/user/code/rr0d/0.3/core_rr0d.c:314:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:318:53: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:319:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:344:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:358:44: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:393:50: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:417:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘dump_data’:
  /home/user/code/rr0d/0.3/core_rr0d.c:457:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:459:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:464:53: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:465:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘_kbdhandle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:817:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:824:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: At top level:
  /home/user/code/rr0d/0.3/core_rr0d.c:841:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘kbdhandle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:845:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘step_by_step’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1041:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1063:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: At top level:
  /home/user/code/rr0d/0.3/core_rr0d.c:1181:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘int0_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1185:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: At top level:
  /home/user/code/rr0d/0.3/core_rr0d.c:1366:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘int1_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1370:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘_int3_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1430:30: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: At top level:
  /home/user/code/rr0d/0.3/core_rr0d.c:1495:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘int3_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1499:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: At top level:
  /home/user/code/rr0d/0.3/core_rr0d.c:1540:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘int6_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1544:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: At top level:
  /home/user/code/rr0d/0.3/core_rr0d.c:1586:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘int13_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1589:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘_int14_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1605:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1606:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: At top level:
  /home/user/code/rr0d/0.3/core_rr0d.c:1648:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘int14_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1651:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘_int128_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1664:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1665:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: At top level:
  /home/user/code/rr0d/0.3/core_rr0d.c:1687:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘int128_handle’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1691:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘init_rr0d’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1791:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1794:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1846:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1848:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1849:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1850:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1851:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1852:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1853:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1854:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c:1869:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  /home/user/code/rr0d/0.3/core_rr0d.c: In function ‘cleanup_rr0d’:
  /home/user/code/rr0d/0.3/core_rr0d.c:1938:36: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  /bin/sh: 1: nobjdump: not found
    CC [M]  /home/user/code/rr0d/0.3/pci.o
  /bin/sh: 1: nobjdump: not found
    LD [M]  /home/user/code/rr0d/0.3/rr0d.o
  /bin/sh: 1: nld: not found
  make[2]: *** [/home/user/code/rr0d/0.3/rr0d.o] Error 127
  make[1]: *** [_module_/home/user/code/rr0d/0.3] Error 2
  make[1]: Leaving directory `/usr/src/linux-3.5.4'
  make: *** [default] Error 2
  </code></pre>