Page MenuHomeFreeBSD

print/foomatic-filters: Fix build with -fno-common
ClosedPublic

Authored by jrm on Aug 23 2020, 12:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 20, 6:14 PM
Unknown Object (File)
Thu, Mar 28, 8:29 AM
Unknown Object (File)
Feb 23 2024, 9:46 AM
Unknown Object (File)
Feb 23 2024, 9:46 AM
Unknown Object (File)
Feb 23 2024, 9:46 AM
Unknown Object (File)
Feb 23 2024, 9:32 AM
Unknown Object (File)
Jan 15 2024, 3:09 AM
Unknown Object (File)
Dec 20 2023, 5:25 AM
Subscribers
None

Details

Summary

PR:
Submitted by:
Reported by:

Test Plan

Build passes on 11.3/12.1 i386/amd64, looking for CURRENT testers

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jrm requested review of this revision.Aug 23 2020, 12:00 PM
jrm created this revision.

This should be fine, an alternative (IIUC, untested) might be to move the declaration of cupsfilter[] to options.h or foomaticrip.h

Perhaps @zeising can weigh in here ;)

So, I've just had a quick look at the code.
char cupsfilter is defined in foomaticrip.c, and also options.c (which this patch changes). It is also declared in foomaticrip.h. I think it should be enough to remove it completely from options.c, since options.c includes foomaticrip.h.
I'm testing the build currently, but it will take a bit of time. I'll let you know once I'm done.

I'm wrong in that you can remove char cupsfilter completely from options.c, I misread the code the first time.

Your patch was not enough, it also gives the following errors:

cc -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -DHAVE_DBUS -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing   -L/usr/local/lib -fstack-protector-strong -o foomatic-rip foomatic_rip-foomaticrip.o  foomatic_rip-options.o foomatic_rip-pdf.o  foomatic_rip-postscript.o foomatic_rip-util.o  foomatic_rip-spooler.o foomatic_rip-process.o  foomatic_rip-renderer.o  foomatic_rip-fileconverter.o foomatic_rip-colord.o -L/usr/local/lib -ldbus-1 -lm
ld: error: duplicate symbol: postpipe
>>> defined at foomaticrip.c
>>>            foomatic_rip-foomaticrip.o:(postpipe)
>>> defined at options.c
>>>            foomatic_rip-options.o:(.bss+0x0)

ld: error: duplicate symbol: printer_model
>>> defined at foomaticrip.c
>>>            foomatic_rip-foomaticrip.o:(printer_model)
>>> defined at options.c
>>>            foomatic_rip-options.o:(.bss+0x144)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [foomatic-rip] Error code 1

I believe the patch I added is correct.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 24 2020, 11:37 AM
This revision was automatically updated to reflect the committed changes.