Opened 14 years ago
Closed 14 years ago
#3650 closed defect (fixed)
Multiply defined symbols when using SunPro compiler.
Reported by: | jhayes | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.7.3 |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
I'm building GDAL with the SunPro compiler. When linking I get multiply defined symbols for CPLAtomicInc and CPLAtomicDec.
I was able to fix it by setting CPL_INLINE when using SunPro (see the patch).
I should not have had to do this. It looks like the idiom GDAL uses to inline functions does not work. For example:
#ifdef CPL_INLINE CPL_INLINE int CPLAtomicInc(volatile int* ptr) {
return CPLAtomicAdd(ptr, 1);
} #else int CPL_DLL CPLAtomicInc(volatile int* ptr); #endif
This will alway take the first branch because CPL_INLINE is always defined.
However the following idiom does
Attachments (3)
Change History (7)
by , 14 years ago
Attachment: | sunpro-inline.patch added |
---|
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Milestone: | → 1.7.3 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
r19884 /trunk/gdal/port/ (cpl_atomic_ops.cpp cpl_atomic_ops.h cpl_port.h): Avoid definition functions in cpl_atomic_port.h if CPL_INLINE is defined to empty (re-fix r19358, #3526) and add support for SunPro compiler while we're at it (#3650)
r19885 /branches/1.7/gdal/port/ (cpl_atomic_ops.cpp cpl_atomic_ops.h cpl_port.h): Avoid definition functions in cpl_atomic_port.h if CPL_INLINE is defined to empty (re-fix r19358, #3526) and add support for SunPro compiler while we're at it (#3650)
by , 14 years ago
Attachment: | sunpro-inline-2.patch added |
---|
by , 14 years ago
Attachment: | sunpro-rasterio.patch added |
---|
comment:3 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
r19886 /trunk/gdal/port/cpl_port.h: Make CPL_INLINE compatible with both SunPro 11 & 12 (#3650)
r19887 /branches/1.7/gdal/port/cpl_port.h: Make CPL_INLINE compatible with both SunPro 11 & 12 (#3650)
For the rasterio thing, please open a separate new ticket with more details why it is necessary. I'm not a C++ expert to judge myself ;-)
Replying to jhayes: ignore the last "However the following idiom does" i did not preview before submitting.