Thread: acerhk wont compile

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    acerhk wont compile

    Hi @all

    I use Slackware 12.2 with Kernel 2.6.27.7

    I tried to compile acerhk, http://www.cakey.de/acerhk/

    I've untared the package in /home/user/acerhk-0.5.35/ and run make

    Code:
    ~/acerhk-0.5.35/# make
    make -C /lib/modules/`uname -r`/build SUBDIRS=/home/user/acerhk-0.5.35 modules
    make[1]: Entering directory `/usr/src/linux-2.6.27.7´
    scripts/Makefile.build:46: *** CFLAGS was changed in "/home/user/acerhk-0.5.35/Makefile". Fix it to use EXTRA_CFLAGS.   Stop.
    make[1]: *** [_module_/home/user/acerhk-0.5.35] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.27.7´
    make: *** [acerhk.ko] Error 2
    ~/acerhk-0.5.35/#
    Ok, I edited the Makefile and changed the following line
    CFLAGS+=-c -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe
    in
    EXTRA_CFLAGS+=...
    and tried again

    Code:
    ~/acerhk-0.5.35/# make
    make -C /lib/modules/`uname -r`/build SUBDIRS=/home/acerhk-0.5.35 modules
    make[1]: Entering directory `/usr/src/linux-2.6.27.7´
      CC [M]  /home/acerhk-0.5.35/acerhk.o
    gcc: -pg and -fomit-frame-pointer are incompatible
    make[2]: *** [/home/user/acerhk-0.5.35/acerhk.o] Error 1
    make[1]: *** [_module_/home/user/acerhk-0.5.35] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.27.7´
    make: *** [acerhk.ko] Error 2
    ~/acerhk-0.5.35/#
    now I don't have any idea where the switch "-pg" comes from or what I can do to fix that problem!

    I hope you'll help me, please.
    Last edited by cretard; 03-09-2009 at 02:50 PM.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    But I suppose you could remove -fomit-frame-pointer, which -pg is incompatible with...

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    396
    you could also try EXTRA_CFLAGS:= instead of += as options seem to be standalone (-fomit-frame-pointer is added for optimization whereas -pg is rather for a debugging version), the best solution however is to contact the author and ask him directly.

  4. #4
    Registered User
    Join Date
    Mar 2009
    Posts
    4
    Quote Originally Posted by matsp View Post
    But I suppose you could remove -fomit-frame-pointer, which -pg is incompatible with...
    yes, but -fomit-frame-pointer is wanted and -pg is unwanted, therefore I think it's better to remove the -pg switch. But, I don't know where it comes from.

    I try to compile without -fomit-frame-pointer:

    Code:
    ~/acerhk-0.5.35/# make
    make -C /lib/modules/`uname -r`/build SUBDIRS=/home/acerhk-0.5.35 modules
    make[1]: Entering directory `/usr/src/linux-2.6.27.7´
      CC [M]  /home/user/acerhk-0.5.35/acerhk.o
    ... a warning ...
    /home/user/acerhk-0.5.35/acerhk.c: In function 'call_bios_52x':
    /home/user/acerhk-0.5.35/acerhk.c:615: error: bp cannot be used in asm here
    make[2]: *** [/home/user/acerhk-0.5.35/acerhk.o] Error 1
    make[1]: *** [_module_/home/user/acerhk-0.5.35] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.27.7´
    make: *** [acerhk.ko] Error 2
    ~/acerhk-0.5.35/#
    that's the function, line 615 is the last line

    Code:
    static asmlinkage void call_bios_52x(struct register_buffer *buf)
    {
      if (bios_routine) {
          local_irq_disable();
    	__asm__ __volatile__(
    						 "movl %2,%%edx\n\t" 
    						 "pusha\n\t"
     						 "movl %%edx,%%ebp\n\t"
    						 "movl (%%ebp),%%eax\n\t"
    						 "movl 4(%%ebp),%%ebx\n\t"
    						 "movl 8(%%ebp),%%ecx\n\t"
    						 "movl 12(%%ebp),%%edx\n\t"
    						 "movl 16(%%ebp),%%edi\n\t"
    						 "movl 20(%%ebp),%%esi\n\t"
    						 "pushl %%ebp\n\t"
    						 "movl %1, %%ebp\n\t"
    						 "call *%0\n\t"
    						 "popl %%ebp\n\t"
    						 "movl %%eax, (%%ebp)\n\t"
    						 "movl %%ebx, 4(%%ebp)\n\t"
    						 "movl %%ecx, 8(%%ebp)\n\t"
    						 "movl %%edx, 12(%%ebp)\n\t"
    						 "movl %%edi, 16(%%ebp)\n\t"
    						 "movl %%esi, 20(%%ebp)\n\t"
    						 "popa\n\t"
    						 :
    						 :"m" (bios_routine), "m" (preg400), "m" (buf)
    						 :"%eax", "%ebx", "%ecx", "%edx", "%edi", "%esi", "%ebp"
    						 );
          local_irq_enable();
      }
    } /* line 615 */

  5. #5
    Registered User
    Join Date
    Mar 2009
    Posts
    4
    Quote Originally Posted by root4 View Post
    you could also try EXTRA_CFLAGS:= instead of += [...], the best solution however is to contact the author and ask him directly.
    EXTRA_CFLAGS:= results in the same problem

    yes, I thought about to contact the author directly, but the software is unsupported since 2005, but ... hm

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    396
    ...to remove the -pg switch. But, I don't know where it comes from.
    it's the kernel module makefile which is called for the 2.6 version (.ko instead of .o) so the -pg flag probably comes from there; try to take a look in it and perhaps compile the source by hand.

  7. #7
    Registered User
    Join Date
    Mar 2009
    Posts
    4
    Quote Originally Posted by root4 View Post
    it's the kernel module makefile which is called for the 2.6 version ...
    I don't know which makefile you mean. The one that comes with the acerhk package didn't contain a -pg flag

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Actually, -fomit-frame-pointer may well not fix that problem. After all, there is no guarantee that this switch will be honoured - if the compiler decides it is better to generate fp, it will do.

    How you tell gcc that "Look, I want to use %ebp here, and you don't have to worry, I will get it back for you", I have no real good idea.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #9
    Registered User
    Join Date
    Mar 2009
    Location
    Manaus, Amazon, Brazil
    Posts
    1
    Quote Originally Posted by cretard View Post
    I don't know which makefile you mean. The one that comes with the acerhk package didn't contain a -pg flag

    Hi cretard, in a coincidence I'm having exactly the same trouble, but my kernel is 2.6.27-11 and I am using Ubuntu Intrepid. I found the makefile you are looking for.
    In my case it's /usr/src/linux-headers-2.6.27-11-generic/Makefile, apparently the makefile of acerhk makes reference to this one.
    I just made this little comment on the line 550:

    Code:
    ifdef CONFIG_FTRACE
    #KBUILD_CFLAGS  += -pg
    endif
    The acerhk compiled fine, but my laptop is a hp pavilion dv4-1125br and the driver didn't worked for me
    I got a
    Code:
    FATAL: Error inserting acerhk (/lib/modules/2.6.27-11-generic/kernel/ubuntu/misc/acerhk.ko): Cannot allocate memory

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C and C++ compile speed
    By swgh in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-02-2007, 02:37 PM
  2. Compile as you type
    By Rocketmagnet in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 12-07-2006, 01:36 PM
  3. How to compile mfc libs from platform sdk
    By tjcbs in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2006, 08:20 AM
  4. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 09:05 PM
  5. How can I compile C or C++ with Visual Studio .NET?
    By Dakkon in forum C Programming
    Replies: 8
    Last Post: 02-11-2003, 02:58 PM