Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

unable to compile a non-gentoo kernel

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
Author
Message
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

unable to compile a non-gentoo kernel

  • Quote

Post by Adel Ahmed » Sun Feb 13, 2022 4:05 am

Hello everyone, I'm trying to install gentoo to my galaxy note3 mobile phone.
I have downloaded a stage 3 and setup my chroot, instead of downloading gentoo sources and having to go through all sorts of hell trying to find the kernel patches from samsung ...etc I chose to downlaod a note3 kernel from the internet:
https://github.com/flashka07/android_ke ... msung_ha3g

this is a very old kerenl version(3.4) that requires gcc4 or 3:

Code: Select all

localhost /root/kernel/android_kernel_samsung_ha3g/include/linux # ls *gcc*
compiler-gcc.h   compiler-gcc3.h  compiler-gcc4.h
so i created a symbolic link in this directory called compiler-gcc11.h and had it point to compiler-gcc.h
I can begin the compilation process but it's not long before I get:

Code: Select all

localhost /root/kernel/android_kernel_samsung_ha3g # make -j4
  CHK     include/linux/version.h
  CC      scripts/mod/empty.o
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  CHK     include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
In file included from include/linux/compiler.h:48,
                 from include/linux/stddef.h:4,
                 from include/linux/posix_types.h:4,
                 from include/linux/types.h:17,
                 from include/linux/page-flags.h:8,
                 from kernel/bounds.c:9:
include/linux/compiler-gcc.h:3:2: error: #error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
    3 | #error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
      |  ^~~~~
In file included from /root/kernel/android_kernel_samsung_ha3g/arch/arm/include/asm/bug.h:59,
                 from include/linux/bug.h:4,
                 from include/linux/page-flags.h:9,
                 from kernel/bounds.c:9:
include/asm-generic/bug.h:64:17: error: expected declaration specifiers or '...' before numeric constant
   64 | extern __printf(3, 4)
      |                 ^
include/asm-generic/bug.h:64:20: error: expected declaration specifiers or '...' before numeric constant
   64 | extern __printf(3, 4)
      |                    ^
include/asm-generic/bug.h:67:17: error: expected declaration specifiers or '...' before numeric constant
   67 | extern __printf(4, 5)
      |                 ^
include/asm-generic/bug.h:67:20: error: expected declaration specifiers or '...' before numeric constant
   67 | extern __printf(4, 5)
      |                    ^
make[1]: *** [/root/kernel/android_kernel_samsung_ha3g/./Kbuild:36: kernel/bounds.s] Error 1
make: *** [Makefile:992: prepare0] Error 2
make: *** Waiting for unfinished jobs....
  HOSTLD  scripts/mod/modpost
any idea what I should do here?
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2115
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

Re: unable to compile a non-gentoo kernel

  • Quote

Post by GDH-gentoo » Sun Feb 13, 2022 2:02 pm

Adel Ahmed wrote:I chose to downlaod a note3 kernel from the internet:
https://github.com/flashka07/android_ke ... msung_ha3g

this is a very old kerenl version(3.4) that requires gcc4 or 3:

Code: Select all

localhost /root/kernel/android_kernel_samsung_ha3g/include/linux # ls *gcc*
compiler-gcc.h   compiler-gcc3.h  compiler-gcc4.h
[...]
any idea what I should do here?
Have you tried building that kernel with the unmodified files? include/linux/compiler-gcc3.h and include/linux/compiler-gcc4.h only contain less than / greater than [or equal to] GCC version comparisons. I wouldn't touch them unless you are getting an actual build failure which these files are directly responsible of.
Top
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

  • Quote

Post by Adel Ahmed » Mon Feb 14, 2022 9:20 am

I tried compiling by linking to gcc3 and gcc4 files but I got the exact same result.
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2115
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Mon Feb 14, 2022 11:29 am

Adel Ahmed wrote:I tried compiling by linking to gcc3 and gcc4 files but I got the exact same result.
What did you link to what? Don't do that. Looking at the Git repository, none of the compiler*.h files is a symlink.
Top
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

  • Quote

Post by Adel Ahmed » Mon Feb 14, 2022 11:54 am

I used to set compiler-gcc11.h as a symbolic link to compiler-gcc.h, can't even remember why i did that.
I removed the symbolic link anyway and I'm getting the same error
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2115
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Mon Feb 14, 2022 12:23 pm

Is include/linux/compiler.h (without -gcc ) a symlink? Can you post the output of ls -l /root/kernel/android_kernel_samsung_ha3g/include/linux/compiler*?
Top
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

  • Quote

Post by Adel Ahmed » Mon Feb 14, 2022 1:55 pm

Code: Select all

localhost /root/kernel/android_kernel_samsung_ha3g #  ls -l /root/kernel/android_kernel_samsung_ha3g/include/linux/compiler*
-rw-r--r-- 1 root root 4547 Feb 13 03:46 /root/kernel/android_kernel_samsung_ha3g/include/linux/compiler-gcc.h
-rw-r--r-- 1 root root  631 Feb  9 14:25 /root/kernel/android_kernel_samsung_ha3g/include/linux/compiler-gcc3.h
-rw-r--r-- 1 root root 2143 Feb  9 14:25 /root/kernel/android_kernel_samsung_ha3g/include/linux/compiler-gcc4.h
-rw-r--r-- 1 root root  746 Feb  9 14:25 /root/kernel/android_kernel_samsung_ha3g/include/linux/compiler-intel.h
-rw-r--r-- 1 root root 8694 Feb  9 14:25 /root/kernel/android_kernel_samsung_ha3g/include/linux/compiler.h
Top
Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic