Don't add -Wl,-N on Apple platform.

* configure.ac (TARGET_LDFLAGS_OLDMAGIC): New subst.
	* conf/Makefile.common: Use TARGET_LDFLAGS_OLDMAGIC instead of -Wl,-N
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-29 16:30:20 +01:00
parent c4c48c541c
commit 46cf439c98
3 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2012-02-29 Vladimir Serbinenko <phcoder@gmail.com>
Don't add -Wl,-N on Apple platform.
* configure.ac (TARGET_LDFLAGS_OLDMAGIC): New subst.
* conf/Makefile.common: Use TARGET_LDFLAGS_OLDMAGIC instead of -Wl,-N
2012-02-29 Vladimir Serbinenko <phcoder@gmail.com> 2012-02-29 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/Makefile.core.def (lzma_decompress): Use * grub-core/Makefile.core.def (lzma_decompress): Use

View file

@ -68,7 +68,7 @@ endif
endif endif
CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N -static-libgcc LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -static-libgcc
CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
if COND_CYGWIN if COND_CYGWIN
@ -78,12 +78,12 @@ STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment
endif endif
CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N,-r,-d LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d
CPPFLAGS_MODULE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) CPPFLAGS_MODULE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
CCASFLAGS_MODULE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) CCASFLAGS_MODULE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
CFLAGS_IMAGE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -fno-builtin CFLAGS_IMAGE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -fno-builtin
LDFLAGS_IMAGE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N,-S LDFLAGS_IMAGE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-S
CPPFLAGS_IMAGE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) CPPFLAGS_IMAGE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
CCASFLAGS_IMAGE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) CCASFLAGS_IMAGE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)

View file

@ -470,8 +470,10 @@ if test x$grub_cv_apple_target_cc = xyes ; then
TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20' TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20' TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
TARGET_IMG_BASE_LDOPT="-Wl,-image_base" TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
TARGET_LDFLAGS_OLDMAGIC=""
else else
TARGET_APPLE_CC=0 TARGET_APPLE_CC=0
TARGET_LDFLAGS_OLDMAGIC="-W,-N"
# Use linker script if present, otherwise use builtin -N script. # Use linker script if present, otherwise use builtin -N script.
if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
@ -487,6 +489,8 @@ fi
TARGET_IMG_CFLAGS= TARGET_IMG_CFLAGS=
fi fi
AC_SUBST(TARGET_LDFLAGS_OLDMAGIC)
# For platforms where ELF is not the default link format. # For platforms where ELF is not the default link format.
AC_MSG_CHECKING([for command to convert module to ELF format]) AC_MSG_CHECKING([for command to convert module to ELF format])
case "${host_os}" in case "${host_os}" in