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

Windows 64-bit: warning: -fPIC ignored for target (all code is position independent) #20508

Closed
embray opened this issue Apr 27, 2016 · 10 comments

Comments

@embray
Copy link
Contributor

embray commented Apr 27, 2016

This is an annoying warning that GCC always outputs on Cygwin either 32-bit or 64-bit. It's harmless really but it is output for every single compiled source file--C or fortran--and there is no -Wno- flag to disable it.

There is a patch now in GCC to remove this outright: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00836.html But I don't know when it will be available. The default GCC currently in Cygwin is 5.3, and it does not have this patch.

It's not worth putting in a lot of effort over this, but I'm squashing it wherever I see it by just removing the -fPIC flag (if possible) on Cygwin. I will maintain a branch for these changes wherever I come across them.

Upstream: Fixed upstream, in a later stable release.

Component: porting: Cygwin

Author: Erik Bray

Branch/Commit: u/embray/cygwin-fpic @ 3302dc8

Issue created by migration from https://trac.sagemath.org/ticket/20508

@embray embray added this to the sage-7.2 milestone Apr 27, 2016
@embray embray self-assigned this Apr 27, 2016
@embray embray removed this from the sage-7.2 milestone Jul 6, 2016
@embray
Copy link
Contributor Author

embray commented Jul 6, 2016

Author: Erik Bray

@embray
Copy link
Contributor Author

embray commented Jul 6, 2016

Commit: 3302dc8

@embray
Copy link
Contributor Author

embray commented Jul 6, 2016

comment:3

Went ahead and fixed this for most, if not all packages, while waiting for a build to finish.

Again, the only thing this is fixing as an annoying warning (that will appear for almost every file compiled) on Cygwin where the -fPIC flag is enabled. If future spkgs add this flag it's not a big deal.


Last 10 new commits:

78ecb4fDisable -fPIC when building libfplll on Cygwin
6c28afcDisable -fPIC when building libpng on Cygwin
65efc90Disable -fPIC when building m4ri and m4rie on Cygwin
048b1ffDisable -fPIC when building meataxe on Cygwin
60bf280Disable -fPIC when building modular_decomposition on Cygwin
8bd68beDisable -fPIC when building mpfi on Cygwin
fa849c8Disable -fPIC when building ratpoints on Cygwin
f1d3819Disable -fPIC when building singular on Cygwin
ea62369Disable -fPIC when building symmetrica on Cygwin
3302dc8Disable -fPIC when building termcap on Cygwin

@embray
Copy link
Contributor Author

embray commented Jul 6, 2016

Branch: u/embray/cygwin-fpic

@jdemeyer
Copy link

comment:4

I don't like adding pointless complexity to spkg-install files. I'm not setting the ticket to needs_work for this, but I really don't see the point...

@embray
Copy link
Contributor Author

embray commented Jul 15, 2016

comment:5

The point is that without this build outputs on Cygwin are almost line noise.

Adding a single conditional when there are already plenty is hardly "complexity". In the meantime I'm still working to squash the need for duplicating stuff in all these spkg-installs. Please give this a positive review.

@jdemeyer
Copy link

comment:6

Here is a cleaner suggestion: in sage-env, define a variable (just a local variable, no need to export it) called fPIC set to either "-fPIC" or "". Then you can replace -fPIC by $fPIC in spkg-install files without conditionals.

@embray
Copy link
Contributor Author

embray commented Jul 15, 2016

comment:7

That would be okay, sure. Is sage-env the best place for that though? Over in #20218 I added a PIP_INSTALL variable used in most Python packages for the common pip options to build/make/install. Maybe that's not great now that I think about it, since it means running spkg-install manually won't work. But I don't know if that's supposed to work or not.

On the other hand I don't like cluttering sage-env with countless environment variables used only for building, unless there's a way to do add such variables only at build time?

@jdemeyer
Copy link

comment:8

Replying to @embray:

On the other hand I don't like cluttering sage-env with countless environment variables used only for building, unless there's a way to do add such variables only at build time?

Like I said, it doesn't have to be an environment variable, just a shell variable. I don't think it costs a lot to have such variables so I don't really see the problem.

@embray
Copy link
Contributor Author

embray commented Jul 15, 2016

comment:9

Okay, in that case I'll try that.

@mkoeppe mkoeppe closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants