Closed Bug 484411 Opened 16 years ago Closed 5 years ago

Mac OS X 32-bit build uses deprecated Code Fragment Manager functions

Categories

(NSPR :: NSPR, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: glenbeasley, Assigned: glandium)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Mac OS X 32-bit build of NSPR uses deprecated Code Fragment Manager functions and deprecated image loading functions. At some point we should use the Dynamic Loader functions (declared in <dlfcn.h>) like the 64-bit Mac OS X code does. See bug 370766. Code Fragment Manager functions Deprecated in Mac OS X v10.5. http://developer.apple.com/documentation/Carbon/Reference/Code_Fragment_Manager/Reference/reference.html Dynamic Loader Available in Mac OS X 10.3 and later http://developer.apple.com/documentation/DeveloperTools/Reference/MachOReference/Reference/reference.html 32-bit build of prlink.c gcc -o prlink.o -c -Wmost -fno-common -pthread -g -fPIC -UNDEBUG -DDEBUG_b -DDEBUG=1 -DXP_UNIX=1 -DDARWIN=1 -DHAVE_BSD_FLOCK=1 -DHAVE_SOCKLEN_T=1 -DXP_MACOSX=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_ -I/Users/b/tip/mozilla/security/nss/../../dist/Darwin9.6.0_DBG.OBJ/include -I../../../../pr/include -I../../../../pr/include/private -I/Developer/Headers/FlatCarbon ../../../../pr/src/linking/prlink.c ../../../../pr/src/linking/prlink.c: In function ‘pr_LoadMachDyldModule’: ../../../../pr/src/linking/prlink.c:558: warning: ‘NSCreateObjectFileImageFromFile’ is deprecated (declared at /usr/include/mach-o/dyld.h:145) ../../../../pr/src/linking/prlink.c:560: warning: ‘NSLinkModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:161) ../../../../pr/src/linking/prlink.c:566: warning: ‘NSDestroyObjectFileImage’ is deprecated (declared at /usr/include/mach-o/dyld.h:147) ../../../../pr/src/linking/prlink.c:568: warning: ‘NSUnLinkModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:169) ../../../../pr/src/linking/prlink.c: In function ‘pr_LoadViaDyld’: ../../../../pr/src/linking/prlink.c:720: warning: ‘NSAddImage’ is deprecated (declared at /usr/include/mach-o/dyld.h:230) ../../../../pr/src/linking/prlink.c:727: warning: ‘NSLinkEditError’ is deprecated (declared at /usr/include/mach-o/dyld.h:217) ../../../../pr/src/linking/prlink.c: In function ‘PR_UnloadLibrary’: ../../../../pr/src/linking/prlink.c:1089: warning: ‘NSUnLinkModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:169) ../../../../pr/src/linking/prlink.c:1105: warning: ‘CloseConnection’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h:382) ../../../../pr/src/linking/prlink.c: In function ‘pr_FindSymbolInLib’: ../../../../pr/src/linking/prlink.c:1218: warning: ‘c2pstrcpy’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h:578) ../../../../pr/src/linking/prlink.c:1220: warning: ‘FindSymbol’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h:401) ../../../../pr/src/linking/prlink.c:1233: warning: ‘NSLookupSymbolInImage’ is deprecated (declared at /usr/include/mach-o/dyld.h:182) ../../../../pr/src/linking/prlink.c:1237: warning: ‘NSAddressOfSymbol’ is deprecated (declared at /usr/include/mach-o/dyld.h:188) ../../../../pr/src/linking/prlink.c:1261: warning: ‘NSLookupSymbolInModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:181) ../../../../pr/src/linking/prlink.c:1263: warning: ‘NSAddressOfSymbol’ is deprecated (declared at /usr/include/mach-o/dyld.h:188)

This is still relevant and affects NSPR on Apple Silicon.

QA Contact: jjones

The API has been deprecated since macOS 10.5, 12 years ago.
The replacement API we use instead (dlopen), has been available since
macOS 10.3, and NSPR has been using it on x86_64 and iPhoneOS for a long
time. It is time to switch other Darwin-based platforms.

Assignee: glenbeasley → mh+mozilla
Blocks: 1658671

With support for macOS < 10.3 dropped, we don't need to care about
special cases for 10.1 anymore, which were the last places using
XP_MACOSX, which we can remove. And as per the previous change,
OS_TARGET=MacOSX is not used anymore. The value will now be Darwin
on all Darwin-based platforms. Also, as per the previous change,
we don't need to check for Carbon anymore.

I couldn't look into this earlier, sorry.

The patches look good to me. But we must release NSPR 4.28 for this dev cycle today.

I suggest to target NSPR 4.29 for Firefox 82 for this work.
We can land it tomorrow/monday.

Depends on: 1660367
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: