Opened 7 years ago

Last modified 6 years ago

#20508 needs_work defect

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

Reported by: Erik Bray Owned by: Erik Bray
Priority: trivial Milestone: sage-wishlist
Component: porting: Cygwin Keywords:
Cc: Merged in:
Authors: Erik Bray Reviewers:
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: u/embray/cygwin-fpic (Commits, GitHub, GitLab) Commit: 3302dc8cd42338976dfa232dc9b9c6281d52a289
Dependencies: Stopgaps:

Status badges

Description

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.

Change History (10)

comment:1 Changed 7 years ago by Erik Bray

Owner: set to Erik Bray

comment:2 Changed 6 years ago by Erik Bray

Milestone: sage-7.2sage-wishlist

comment:3 Changed 6 years ago by Erik Bray

Authors: Erik Bray
Branch: u/embray/cygwin-fpic
Commit: 3302dc8cd42338976dfa232dc9b9c6281d52a289
Status: newneeds_review

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

comment:4 Changed 6 years ago by Jeroen Demeyer

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...

comment:5 Changed 6 years ago by Erik Bray

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.

comment:6 Changed 6 years ago by Jeroen Demeyer

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.

comment:7 Changed 6 years ago by Erik Bray

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?

comment:8 in reply to:  7 Changed 6 years ago by Jeroen Demeyer

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.

comment:9 Changed 6 years ago by Erik Bray

Okay, in that case I'll try that.

comment:10 Changed 6 years ago by Jeroen Demeyer

Status: needs_reviewneeds_work
Note: See TracTickets for help on using tickets.