Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIE disabled. Absolute addressing not allowed in code signed PIE #94

Open
shankar667 opened this issue Jul 26, 2017 · 6 comments
Open

Comments

@shankar667
Copy link

Hi,
I'm using Red5Pro SDK for iOS and getting the following warning, can you please guide me to resolve this issue?

warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _av_d2str from /Users/staff/Desktop/app/R5Streaming.framework/R5Streaming(avstring.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

Also, I've done some research, most of the people suggesting the reference: https://developer.apple.com/library/content/qa/qa1788/_index.html#/apple_ref/doc/uid/DTS40013354
but I didn't see the option "Don't Create Position Independent Executables" in Targets section -> "Build Settings"

I'm using Xcode 8.3.3 with Deployment target is 8.0

Thank you!

@beetlejesss
Copy link
Contributor

@shankar667 are you getting that warning using this project, or with your own project? Is the warning preventing you from building and/or running the application?

If you are getting the error with your own project, then please submit a ticket to the helpdesk (https://red5pro.zendesk.com/hc/en-us/requests/new) so that we can assist you there.

@shankar667
Copy link
Author

I'm getting that warning using this project and also my own project and it's not preventing from building the application.

Warning from this project:

ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _av_d2str from /Users/staff/Desktop/test/streaming-ios-master/R5ProTestbed/R5Streaming.framework/R5Streaming(avstring.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

@shankar667
Copy link
Author

I've done some more research and finally set Generate Position-Dependent Executable = Yes in Targets and Project -> Build Settings then warning won't appears but I'm not sure wether apple will accept the build, can you please more investigate in this issue and guide us with proper solutions?

As per my research Generate Position-Dependent Executable will apply entire application not only for R5Streaming.framework, is this acceptable?

And based on the reference URL:
https://developer.apple.com/library/content/qa/qa1788/_index.html#/apple_ref/doc/uid/DTS40013354.
I also verified using the command otool -hv the application was built as PIE . The results shows as below

Mach header

magic		cputype		cpusubtype	caps	filetyp	ncmds	sizeofcmds	lags
MH_MAGIC	ARM		V7		0x00	EXECUTE	66	6516		NOUNDEFS DYLDLINK TWOLEVEL BINDS_TO_WEAK

@beetlejesss
Copy link
Contributor

we have those settings set as described in the article you posted

running otool on a build of streaming-ios app:

     magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
  MH_MAGIC     ARM         V7  0x00     EXECUTE    50       5300   NOUNDEFS DYLDLINK TWOLEVEL BINDS_TO_WEAK
Mach header
     magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64   ARM64        ALL  0x00     EXECUTE    50       6056   NOUNDEFS DYLDLINK TWOLEVEL BINDS_TO_WEAK PIE

I see PIE set for ALL ARM64

@shankar667
Copy link
Author

Yes, of course. I also see the PIE for ARM64 because your R5Streaming.framework enabled PIE for ARM64 architecture, but Xcode not enabled PIE support by default, in settings. So, that the warning displays all the time.

As described in my above article Generate Position-Dependent Executable = Yes solved my problem at present. But can you clarify "is this setting will cause to reject the build"?

@beetlejesss
Copy link
Contributor

I'm sorry, that is more of a question for Apple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants