Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#12441 closed defect (worksforme)

mac os 10.8.2,can't compile openwrt

Reported by: sniperpr@… Owned by: developers
Priority: highest Milestone: Barrier Breaker 14.07
Component: base system Version: Attitude Adjustment 12.09 Beta
Keywords: max X 10.8.2 Cc:

Description

https://forum.openwrt.org/viewtopic.php?id=34676

i'm has install macports and xcode.

but make V=99 has this log.

/lib/ext2fs/ext2fs.h:1559:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_resize_mem' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1555:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_resize_mem' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1541:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_free_mem' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1538:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_free_mem' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1527:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_get_arrayzero' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1506:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_get_memzero' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1505:2: warning: '__inline_memset_chk' is static but used in inline function 'ext2fs_get_memzero' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1494:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_get_mem' which is not static [enabled by default]
	CC sigcatcher.c
In file included from e2fsck.h:35:0,
                 from sigcatcher.c:21:
../lib/ext2fs/ext2fs.h:1559:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_resize_mem' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1555:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_resize_mem' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1541:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_free_mem' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1538:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_free_mem' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1527:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_get_arrayzero' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1506:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_get_memzero' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1505:2: warning: '__inline_memset_chk' is static but used in inline function 'ext2fs_get_memzero' which is not static [enabled by default]
../lib/ext2fs/ext2fs.h:1494:2: warning: '__inline_memcpy_chk' is static but used in inline function 'ext2fs_get_mem' which is not static [enabled by default]
	LD e2fsck
gcc: error: unrecognized command line option '-rdynamic'
make[6]: *** [e2fsck] Error 1
make[5]: *** [all-progs-recursive] Error 1
make[4]: *** [all] Error 2
make[3]: *** [/Users/soltek/openwrt/attitude_adjustment/build_dir/host/e2fsprogs-1.42.4/.built] Error 2
make[3]: Leaving directory `/Users/soltek/openwrt/attitude_adjustment/tools/e2fsprogs'
make[2]: *** [tools/e2fsprogs/compile] Error 2
make[2]: Leaving directory `/Users/soltek/openwrt/attitude_adjustment'
make[1]: *** [/Users/soltek/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/stamp/.tools_install_nnnnn] Error 2
make[1]: Leaving directory `/Users/soltek/openwrt/attitude_adjustment'
make: *** [world] Error 2
huangluetekiMacBook-Pro:attitude_adjustment soltek$ 

Attachments (0)

Change History (5)

comment:1 Changed 5 years ago by anonymous

You are missing the compile command that includes the -rdynamic flag (which is what caused the error).

comment:2 Changed 5 years ago by anonymous

OSX (darwin) gcc does not support the -rdynamic flag. Suggest you grep the Makefiles for it and just plainly remove it.

comment:3 Changed 4 years ago by anonymous

This worked in the past because Apple's gcc compiler silently ignored the "-rdynamic" flag (it is for ELF binaries only). Unfortunately, Apple has dropped support for gcc in its latest OS so OpenWRT needs to be built with vanilla gcc on OS X. Vanilla gcc doesn't support "-rdynamic" on Mach-O systems.

Vanilla GCC:
$ gcc-mp-4.7 -rdynamic test.c -o test
gcc-mp-4.7: unrecognized option '-rdynamic'

Apple's GCC:
$ llvm-gcc-4.2 -rdynamic test.c -o test
$ ./test
Hello World!

Here's a patch fixes the problem on some OS X systems. Put this is tools/e2fsprogs/patches and rebuild.

--- a/configure.in	2012-05-28 20:29:48.000000000 -0500
+++ b/configure.in	2013-10-30 11:07:26.000000000 -0500
@@ -96,7 +96,10 @@
 dnl
 AC_PROG_CC
 if test "$GCC" = yes; then
-   RDYNAMIC="-rdynamic"
+   case "$host_os" in
+     darwin*) RDYNAMIC="" ;;
+     *) RDYNAMIC="-rdynamic" ;;
+   esac
    AC_SUBST(RDYNAMIC)
 fi
 AC_PROG_CPP
--- a/configure	2012-05-28 20:29:48.000000000 -0500
+++ b/configure	2013-10-30 11:49:32.000000000 -0500
@@ -4176,7 +4176,10 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 if test "$GCC" = yes; then
-   RDYNAMIC="-rdynamic"
+   case "$host_os" in
+     darwin*) RDYNAMIC="" ;;
+     *) RDYNAMIC="-rdynamic" ;;
+   esac
 
 fi
 ac_ext=c

comment:4 Changed 4 years ago by nbd

  • Resolution set to worksforme
  • Status changed from new to closed

tools are now built using clang on mac os x (tested on 10.9). please reopen if the problem is still there with the updates.

comment:5 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.