Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2018 12:52:23 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        blubee blubeeme <gurenchan@gmail.com>
Cc:        Lorenzo Salvadore <phascolarctos@protonmail.ch>, FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Re: error: undefined symbol: main in poudriere jail
Message-ID:  <CAPyFy2Buh%2B3rnLn5B29OVOKeje3jwusPAJyEdA11rBAk9NQJkw@mail.gmail.com>
In-Reply-To: <CALM2mEkXrJYy%2B4Dp%2B=e4H04fEojcrvHMoEStn_u%2B-5bqkOoRxA@mail.gmail.com>
References:  <CALM2mEnTp2aPWCcBQ-zUrSo_vdfSU0b=pXoEuAto_kytPnvUgg@mail.gmail.com> <CDduIhEqP4vsAGt5p9RXp80UXqbhGB5dv_xW33IcdKyLT6_t2y0NYRlI5oS3zOViJwrPM_W36TWeD2HP2zH3Ho6wLDDFl_KFcZk9Iffe6B8=@protonmail.ch> <CALM2mEm9Y1VN_E2aewF1bjUvjf_M=LXCXG%2B_wTThbXibRPJLAQ@mail.gmail.com> <OdD0OcqjfcWKjW82n18JR1aYjNY3hTwTQOqL9Wdie2xGAx1MvMOphXeV106wtARfCdO0bKxrJ49_xaqWviBjketPgwaeCxwRK1e5k27w1s0=@protonmail.ch> <CALM2mEnpzv=-DOOo_%2BJS8Hisbd1d2PC5Bi32XzOjRLi53hoHGg@mail.gmail.com> <80YyfudNFYVUtc4P60c1AMVhIjsVj7XHpJe0-aRigq3pHBOfzIz43bX1PGoxSUVid2fc_hqmWVPEIDbkm2zasAvEzhKppit4gbiRhgsP85o=@protonmail.ch> <CALM2mEnK_qgO20ayFQXmCXbBNQBr3PnDk8Ei3XSLg7qM5dYQdw@mail.gmail.com> <CAPyFy2BSaykmS4yxqcJS2xh431VQdbEBv2C8euKhyNM_xbbBow@mail.gmail.com> <8kOQ7j3r5oiQBEhZPRxAfHhN48SOQnjRQI366657W_HGLGSwxHgSQyBqcZzdpaBGgnLKSdVnyVx3dTJJzj0CP5kyxQ2FK59pY-nRJ1B4vrg=@protonmail.ch> <CALM2mEkXrJYy%2B4Dp%2B=e4H04fEojcrvHMoEStn_u%2B-5bqkOoRxA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 25 September 2018 at 09:29, blubee blubeeme <gurenchan@gmail.com> wrote:
> On Tue, Sep 25, 2018 at 5:27 PM Lorenzo Salvadore via freebsd-ports <
> freebsd-ports@freebsd.org> wrote:
>
>> > > That's the problem, the same code works for earlier version of FreeBSD.
>> >
>> > You can try switching back to the old GNU ld via something like "ln
>> > -fs ld.bfd /usr/bin/ld" and building the port on 12. (Or, set
>> > WITHOUT_LLD_IS_LD in src.conf.) If that works I'll try to suggest some
>> > further steps.
>
> going into the jail on this failed poudiere build making the symlink and
> building; the build succeeds.

Ok - it is very strange that using BFD ld vs lld causes main() to
appear or not in one of the objects being linked; I suspect this is a
2nd-order effect of some build-time test that's failing for some
reason with lld.

Briefly, at a high-level there are two ways to approach a case like
this: get the port linking with GNU ld, or find and fix the root
cause. Ports has a knob LLD_UNSAFE that should cause base ld.bfd or
one from the binutils package to be used, but it does not work in some
cases (generally, ports with old embedded libtool or that otherwise do
not honour LDFLAGS or CFLAGS).

To take this to root cause there's probably a straightforward (if
long/tedious) path to be taken in comparing the results of building in
two jails, one with ld is ld.bfd and one with ld is ld.lld. The link
is failing with ld.lld, so compare the objects passed to the link
invocations between the two cases and find one that contains main() in
the bfd case and not in the lld case, and work backwards from there.

You can set LLD_REPRODUCE=_something_.tar in the environment and lld
will create a tarball of all inputs, command line, etc. for further
investigation.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2Buh%2B3rnLn5B29OVOKeje3jwusPAJyEdA11rBAk9NQJkw>