[asterisk-dev] [Code Review]: sparc64 compile error, undefined reference to `__sync_fetch_and_add_4'

wdoekes reviewboard at asterisk.org
Tue Nov 8 05:17:09 CST 2011



> On Nov. 6, 2011, 5:20 a.m., Tzafrir Cohen wrote:
> > Sorry. I must have missed it. This whole thing should go away. Those tests may belong in the configure script, if at all. You should also note that the build system is not necessarily the running system.
> > 
> > Anyway, what is the minimal version of GCC supported by Asterisk nowadays?
> 
> Tzafrir Cohen wrote:
>     When I asked about it on a certain sparc IRC channel someone noted that setting -mcpu is normally unnecessary.

Ok. Tzafrir and I agree that the whole mcpu setting should not be done in the Makefile at all.

Something like this should probably be a start:


Index: Makefile
===================================================================
--- Makefile	(revision 343785)
+++ Makefile	(working copy)
@@ -169,14 +169,11 @@
   endif
 
   ifeq ($(PROC),sparc64)
-    #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-    #This works for even old (2.96) versions of gcc and provides a small boost either way.
-    #A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
-    #So we go lowest common available by gcc and go a step down, still a step up from
-    #the default as we now have a better instruction set to work with. - Belgarath
+    # This conditional CC stuff should go away. If you're cross compiling, things will break.
+    # If you need special CFLAGS, provide them in the environment before calling
+    # ./configure.
     PROC=ultrasparc
     OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
-    OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v8"; fi)
     OPTIONS+=-fomit-frame-pointer
   endif
 
@@ -221,9 +218,7 @@
 endif
 
 ifeq ($(findstring -march,$(_ASTCFLAGS) $(ASTCFLAGS)),)
-  ifneq ($(PROC),ultrasparc)
-    _ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
-  endif
+  _ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
 endif
 
 ifeq ($(PROC),ppc)


- wdoekes


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1534/#review4703
-----------------------------------------------------------


On Oct. 20, 2011, 12:56 a.m., Alec Davis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1534/
> -----------------------------------------------------------
> 
> (Updated Oct. 20, 2011, 12:56 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Debian Squeeze or Ubuntu 9.04.
> 
> /usr/local/src/asterisk-1.8.7.0/include/asterisk/lock.h:600: undefined reference to `__sync_fetch_and_add_4'
> 
> Previous Debian releases are fine.
> 
> 
> This addresses bugs ASTERISK-17022 and ASTERISK-18651.
>     https://issues.asterisk.org/jira/browse/ASTERISK-17022
>     https://issues.asterisk.org/jira/browse/ASTERISK-18651
> 
> 
> Diffs
> -----
> 
>   trunk/Makefile 341525 
> 
> Diff: https://reviewboard.asterisk.org/r/1534/diff
> 
> 
> Testing
> -------
> 
> Tested sucessfully with;
> Debian Squeeze - where it would previously emit the above message and more.
> Debian Lenny - where it used to work without mcpu=v9
> Debian Etch - where it used to work without mcpu=v9
> 
> 
> Thanks,
> 
> Alec
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111108/c9a40780/attachment.htm>


More information about the asterisk-dev mailing list