A NOTE has been added to this issue. 
====================================================================== 
https://bugtracker.iptel.org/view.php?id=46 
====================================================================== 
Reported By:                peter_lemenkov
Assigned To:                
====================================================================== 
Project:                    SEMS
Issue ID:                   46
Category:                   core
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2010-09-27 16:43 CEST
Last Modified:              2010-10-01 12:42 CEST
====================================================================== 
Summary:                    Cannot compile with gcc 4.1.2 on i386 due to missing
__sync_add_and_fetch/__sync_sub_and_fetch built-ins
Description: 
See this log for the details (scroll to bottom):

http://koji.fedoraproject.org/koji/getfile?taskID=2491566&name=build.log

See - missing necessary built-ins on this architecture (i386). I'll add
workaround for this particular gcc and particular architecture - something
like this:

        static inline int
        ATOMIC_INC_AND_FETCH(int *data, pthread_mutex_t *phlpmut) {
                int val;
                pthread_mutex_lock(phlpmut);
                val = ++(*data);
                pthread_mutex_unlock(phlpmut);
                return(val);
        }

I don't think that something should be added to the main branch - this is
very specific issue, but someone could encounter it too, so I decided to
open this ticket.
====================================================================== 

---------------------------------------------------------------------- 
 (0000073) rco (manager) - 2010-09-28 13:47
 https://bugtracker.iptel.org/view.php?id=46#c73 
---------------------------------------------------------------------- 
Hi Peter,

I just made a patch here, as it concerns any build for any target arch
which does not support the atomic built-ins...

Can you confirm if it works on your side? 

---------------------------------------------------------------------- 
 (0000074) peter_lemenkov (reporter) - 2010-09-28 14:04
 https://bugtracker.iptel.org/view.php?id=46#c74 
---------------------------------------------------------------------- 
Ok, I'll try to rebuild with this patch in a couple of hours. 

---------------------------------------------------------------------- 
 (0000075) peter_lemenkov (reporter) - 2010-09-29 09:59
 https://bugtracker.iptel.org/view.php?id=46#c75 
---------------------------------------------------------------------- 
It builds fine now:

http://koji.fedoraproject.org/koji/taskinfo?taskID=2496100

Unfortunately the patch still needs love as it just drops support for
atomic operations completely (see build logs for all architectures). 

---------------------------------------------------------------------- 
 (0000076) peter_lemenkov (reporter) - 2010-09-29 10:16
 https://bugtracker.iptel.org/view.php?id=46#c76 
---------------------------------------------------------------------- 
A snippet from nspr sources:

#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && \
      ((defined(DARWIN) && \
           (defined(__ppc__) || defined(__i386__) || defined(__x86_64__)))
|| \
       (defined(LINUX) && \
           ((defined(__i386__) && \
           defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \
           defined(__ia64__) || defined(__x86_64__) || \
           (defined(__powerpc__) && !defined(__powerpc64__)) || \
           defined(__alpha)))) 

---------------------------------------------------------------------- 
 (0000077) peter_lemenkov (reporter) - 2010-09-29 11:28
 https://bugtracker.iptel.org/view.php?id=46#c77 
---------------------------------------------------------------------- 
Ok, finally I managed to build sems on all three platforms (ppc, i386 and
x86_64) with falling back to custom locking routine only on i386:

http://koji.fedoraproject.org/koji/taskinfo?taskID=2496252

Patch attached (and applied in my personal repo) 

---------------------------------------------------------------------- 
 (0000078) peter_lemenkov (reporter) - 2010-09-29 11:43
 https://bugtracker.iptel.org/view.php?id=46#c78 
---------------------------------------------------------------------- 
Could someone, please, test building on Darwin? 

---------------------------------------------------------------------- 
 (0000079) rco (manager) - 2010-10-01 12:42
 https://bugtracker.iptel.org/view.php?id=46#c79 
---------------------------------------------------------------------- 
It does work on Darwin (tested on Mac OS X 10.6). However, I cannot test on
powerpc: if someone could, that would help a lot. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-09-27 16:43 peter_lemenkov New Issue                                    
2010-09-28 13:47 rco            Note Added: 0000073                          
2010-09-28 13:48 rco            File Added: atomic_i386.patch                   

2010-09-28 14:04 peter_lemenkov Note Added: 0000074                          
2010-09-29 09:59 peter_lemenkov Note Added: 0000075                          
2010-09-29 10:16 peter_lemenkov Note Added: 0000076                          
2010-09-29 11:22 rco            File Deleted: atomic_i386.patch                 
  
2010-09-29 11:23 rco            File Added: atomic_i386.patch                   

2010-09-29 11:26 peter_lemenkov File Added:
0001-Fix-for-architectures-w-o-atomic-built-in-functions.patch                  
 
2010-09-29 11:28 peter_lemenkov Note Added: 0000077                          
2010-09-29 11:43 peter_lemenkov Note Added: 0000078                          
2010-10-01 12:42 rco            Note Added: 0000079                          
======================================================================
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to