Link errors: "ld: fatal: option -dn and -P are incompatible"
Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Link errors: "ld: fatal: option -dn and -P are incompatible"
I am trying port a linux application to Solaris.
Getting the following error messages during linking
-------
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status
------------
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Perhaps these options are designed to work with a different linker than the Solaris one. In any case, you need to remove one of them for the command to succeed with Solaris ld.
The issue is i am not at all using those options.
I have a Makefile to build the application in Linux, i am trying to use the same to build on Solaris. I am not using either -dn or -P options as part of this.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Well, you are using a C compiler but link with the C++ library and give a DOS extension to your binary. While the latter is not a real issue but just confusing, you should be consistent with the language used.
Is your source code C or C++ ?
What Solaris release are you using ?
What Gnu compiler version ?
Are there specific environment variables set in your shell like LD_OPTIONS ?
I am also facing the same issue.
i.e:
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.