当前位置: 技术问答>linux和unix
redhat as5 更新内核至2.6.38.6时 make不通过
来源: 互联网 发布时间:2016-12-06
本文导语: 各位大虾: 本人使用Vmware安装装的RedHat AS5,准备更新内核至linux-2.6.38.6.tar.bz2,但是遇到一个问题,还请各位大虾不吝赐教。下面都是使用的root用户进行操作。 1)查看当前内核版本 #uname -r 2.6.18-53.el5 2) ...
各位大虾:
本人使用Vmware安装装的RedHat AS5,准备更新内核至linux-2.6.38.6.tar.bz2,但是遇到一个问题,还请各位大虾不吝赐教。下面都是使用的root用户进行操作。
1)查看当前内核版本
#uname -r
2.6.18-53.el5
2) 下载内核 linux-2.6.38.6.tar.bz2
3) 将 linux-2.6.38.6.tar.bz2 拷贝到/usr/local/src目录下面,使用下面的命令解压,得到文件夹 linux-2.6.38.6
tar xjvf linux-2.6.33.tar.bz2
4) 复制原有的config文件到linux-2.6.38.6 目录
#cd /usr/local/src/linux-2.6.38.6
# cp /boot/config-2.6.18-53.el5 .config
5) make menuconfig
选择Load an Alternate Configuration File,导入.config文件,使用用默认配置。
修改完毕选择Save an Alternate Configuration File,然后退出配置。
6) 修改.config文件
在.config文件搜索CONFIG_SYSFS_DEPRECATED,将# CONFIG_SYSFS_DEPRECATED is not set这一行,将该行修改为CONFIG_SYSFS_DEPRECATED=y
7) 编译内核
#make all
[root@localhost linux-2.6.38.6]# make all
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (STUB_POULSBO && DRM_I915) selects ACPI_VIDEO which has unmet direct dependencies (ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT)
*
* Restart config...
*
*
* General setup
*
Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [Y/n/?] y
Cross-compiler tool prefix (CROSS_COMPILE) []
Local version - append to kernel release (LOCALVERSION) []
Automatically append version information to the version string (LOCALVERSION_AUTO) [N/y/?] n
Kernel compression mode
> 1. Gzip (KERNEL_GZIP)
2. Bzip2 (KERNEL_BZIP2)
3. LZMA (KERNEL_LZMA)
4. XZ (KERNEL_XZ)
5. LZO (KERNEL_LZO)
choice[1-5?]: 1
Support for paging of anonymous memory (swap) (SWAP) [Y/n/?] y
System V IPC (SYSVIPC) [Y/n/?] y
POSIX Message Queues (POSIX_MQUEUE) [Y/n/?] y
BSD Process Accounting (BSD_PROCESS_ACCT) [Y/n/?] y
BSD Process Accounting version 3 file format (BSD_PROCESS_ACCT_V3) [N/y/?] n
Export task/process statistics through netlink (EXPERIMENTAL) (TASKSTATS) [Y/n/?] y
Enable per-task delay accounting (EXPERIMENTAL) (TASK_DELAY_ACCT) [Y/n/?] y
Enable extended accounting over taskstats (EXPERIMENTAL) (TASK_XACCT) [N/y/?] n
Auditing support (AUDIT) [Y/n/?] y
Enable system-call auditing support (AUDITSYSCALL) [Y/n/?] y
Kernel .config support (IKCONFIG) [N/m/y/?] n
Kernel log buffer size (16 => 64KB, 17 => 128KB) (LOG_BUF_SHIFT) [17] 17
Automatic process group scheduling (SCHED_AUTOGROUP) [N/y/?] n
enable deprecated sysfs features to support old userspace tools (SYSFS_DEPRECATED) [Y/n/?] y
enabled deprecated sysfs features by default (SYSFS_DEPRECATED_V2) [N/y/?] (NEW) y
Kernel->user space relay support (formerly relayfs) (RELAY) [Y/?] y
Initial RAM filesystem and RAM disk (initramfs/initrd) support (BLK_DEV_INITRD) [Y/n/?] y
Initramfs source file(s) (INITRAMFS_SOURCE) []
Optimize for size (CC_OPTIMIZE_FOR_SIZE) [Y/n/?] y
Embedded system (EMBEDDED) [N/y/?] n
Load all symbols for debugging/ksymoops (KALLSYMS) [Y/?] y
Include all symbols in kallsyms (KALLSYMS_ALL) [N/y/?] n
Do an extra kallsyms pass (KALLSYMS_EXTRA_PASS) [Y/n/?] y
Disable heap randomization (COMPAT_BRK) [Y/n/?] y
Choose SLAB allocator
> 1. SLAB (SLAB)
2. SLUB (Unqueued Allocator) (SLUB)
choice[1-2?]: 1
Profiling support (PROFILING) [Y/n/?] y
OProfile system profiling (OPROFILE) [M/n/y/?] m
OProfile multiplexing support (EXPERIMENTAL) (OPROFILE_EVENT_MULTIPLEX) [N/y/?] n
Kprobes (KPROBES) [Y/n/?] y
Optimize trace point call sites (JUMP_LABEL) [N/y/?] n
warning: (STUB_POULSBO && DRM_I915) selects ACPI_VIDEO which has unmet direct dependencies (ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT)
#
# configuration written to .config
#
warning: (STUB_POULSBO && DRM_I915) selects ACPI_VIDEO which has unmet direct dependencies (ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT)
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CC kernel/bounds.s
在包含自 include/linux/compiler-gcc.h:90 的文件中,
从 include/linux/compiler.h:48,
从 include/linux/stddef.h:4,
从 include/linux/posix_types.h:4,
从 include/linux/types.h:17,
从 include/linux/page-flags.h:8,
从 kernel/bounds.c:9:
[color=#FF0000]include/linux/compiler-gcc4.h:8:4: 错误:#error Your version of gcc miscompiles the __weak directive
make[1]: *** [kernel/bounds.s] 错误 1
make: *** [prepare0] 错误 2
[root@localhost linux-2.6.38.6]# make
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
在包含自 include/linux/compiler-gcc.h:90 的文件中,
从 include/linux/compiler.h:48,
从 include/linux/stddef.h:4,
从 include/linux/posix_types.h:4,
从 include/linux/types.h:17,
从 include/linux/page-flags.h:8,
从 kernel/bounds.c:9:
include/linux/compiler-gcc4.h:8:4: 错误:#error Your version of gcc miscompiles the __weak directive
make[1]: *** [kernel/bounds.s] 错误 1
make: *** [prepare0] 错误 2
[root@localhost linux-2.6.38.6]#[/color]
小弟不知道如何解决红色部分问题,还望各位大虾不吝赐教,小弟先行谢过!
本人使用Vmware安装装的RedHat AS5,准备更新内核至linux-2.6.38.6.tar.bz2,但是遇到一个问题,还请各位大虾不吝赐教。下面都是使用的root用户进行操作。
1)查看当前内核版本
#uname -r
2.6.18-53.el5
2) 下载内核 linux-2.6.38.6.tar.bz2
3) 将 linux-2.6.38.6.tar.bz2 拷贝到/usr/local/src目录下面,使用下面的命令解压,得到文件夹 linux-2.6.38.6
tar xjvf linux-2.6.33.tar.bz2
4) 复制原有的config文件到linux-2.6.38.6 目录
#cd /usr/local/src/linux-2.6.38.6
# cp /boot/config-2.6.18-53.el5 .config
5) make menuconfig
选择Load an Alternate Configuration File,导入.config文件,使用用默认配置。
修改完毕选择Save an Alternate Configuration File,然后退出配置。
6) 修改.config文件
在.config文件搜索CONFIG_SYSFS_DEPRECATED,将# CONFIG_SYSFS_DEPRECATED is not set这一行,将该行修改为CONFIG_SYSFS_DEPRECATED=y
7) 编译内核
#make all
[root@localhost linux-2.6.38.6]# make all
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (STUB_POULSBO && DRM_I915) selects ACPI_VIDEO which has unmet direct dependencies (ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT)
*
* Restart config...
*
*
* General setup
*
Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [Y/n/?] y
Cross-compiler tool prefix (CROSS_COMPILE) []
Local version - append to kernel release (LOCALVERSION) []
Automatically append version information to the version string (LOCALVERSION_AUTO) [N/y/?] n
Kernel compression mode
> 1. Gzip (KERNEL_GZIP)
2. Bzip2 (KERNEL_BZIP2)
3. LZMA (KERNEL_LZMA)
4. XZ (KERNEL_XZ)
5. LZO (KERNEL_LZO)
choice[1-5?]: 1
Support for paging of anonymous memory (swap) (SWAP) [Y/n/?] y
System V IPC (SYSVIPC) [Y/n/?] y
POSIX Message Queues (POSIX_MQUEUE) [Y/n/?] y
BSD Process Accounting (BSD_PROCESS_ACCT) [Y/n/?] y
BSD Process Accounting version 3 file format (BSD_PROCESS_ACCT_V3) [N/y/?] n
Export task/process statistics through netlink (EXPERIMENTAL) (TASKSTATS) [Y/n/?] y
Enable per-task delay accounting (EXPERIMENTAL) (TASK_DELAY_ACCT) [Y/n/?] y
Enable extended accounting over taskstats (EXPERIMENTAL) (TASK_XACCT) [N/y/?] n
Auditing support (AUDIT) [Y/n/?] y
Enable system-call auditing support (AUDITSYSCALL) [Y/n/?] y
Kernel .config support (IKCONFIG) [N/m/y/?] n
Kernel log buffer size (16 => 64KB, 17 => 128KB) (LOG_BUF_SHIFT) [17] 17
Automatic process group scheduling (SCHED_AUTOGROUP) [N/y/?] n
enable deprecated sysfs features to support old userspace tools (SYSFS_DEPRECATED) [Y/n/?] y
enabled deprecated sysfs features by default (SYSFS_DEPRECATED_V2) [N/y/?] (NEW) y
Kernel->user space relay support (formerly relayfs) (RELAY) [Y/?] y
Initial RAM filesystem and RAM disk (initramfs/initrd) support (BLK_DEV_INITRD) [Y/n/?] y
Initramfs source file(s) (INITRAMFS_SOURCE) []
Optimize for size (CC_OPTIMIZE_FOR_SIZE) [Y/n/?] y
Embedded system (EMBEDDED) [N/y/?] n
Load all symbols for debugging/ksymoops (KALLSYMS) [Y/?] y
Include all symbols in kallsyms (KALLSYMS_ALL) [N/y/?] n
Do an extra kallsyms pass (KALLSYMS_EXTRA_PASS) [Y/n/?] y
Disable heap randomization (COMPAT_BRK) [Y/n/?] y
Choose SLAB allocator
> 1. SLAB (SLAB)
2. SLUB (Unqueued Allocator) (SLUB)
choice[1-2?]: 1
Profiling support (PROFILING) [Y/n/?] y
OProfile system profiling (OPROFILE) [M/n/y/?] m
OProfile multiplexing support (EXPERIMENTAL) (OPROFILE_EVENT_MULTIPLEX) [N/y/?] n
Kprobes (KPROBES) [Y/n/?] y
Optimize trace point call sites (JUMP_LABEL) [N/y/?] n
warning: (STUB_POULSBO && DRM_I915) selects ACPI_VIDEO which has unmet direct dependencies (ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT)
#
# configuration written to .config
#
warning: (STUB_POULSBO && DRM_I915) selects ACPI_VIDEO which has unmet direct dependencies (ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT)
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CC kernel/bounds.s
在包含自 include/linux/compiler-gcc.h:90 的文件中,
从 include/linux/compiler.h:48,
从 include/linux/stddef.h:4,
从 include/linux/posix_types.h:4,
从 include/linux/types.h:17,
从 include/linux/page-flags.h:8,
从 kernel/bounds.c:9:
[color=#FF0000]include/linux/compiler-gcc4.h:8:4: 错误:#error Your version of gcc miscompiles the __weak directive
make[1]: *** [kernel/bounds.s] 错误 1
make: *** [prepare0] 错误 2
[root@localhost linux-2.6.38.6]# make
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
在包含自 include/linux/compiler-gcc.h:90 的文件中,
从 include/linux/compiler.h:48,
从 include/linux/stddef.h:4,
从 include/linux/posix_types.h:4,
从 include/linux/types.h:17,
从 include/linux/page-flags.h:8,
从 kernel/bounds.c:9:
include/linux/compiler-gcc4.h:8:4: 错误:#error Your version of gcc miscompiles the __weak directive
make[1]: *** [kernel/bounds.s] 错误 1
make: *** [prepare0] 错误 2
[root@localhost linux-2.6.38.6]#[/color]
小弟不知道如何解决红色部分问题,还望各位大虾不吝赐教,小弟先行谢过!
|
打开内核源码中include/linux/compiler-gcc4.h文件,看第8行:
# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__
# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__