Page MenuHomeFreeBSD

[PowerPC64] fix www/node build and runtime when using ELFv2 ABI
AcceptedPublic

Authored by alfredo.junior_eldorado.org.br on Tue, Sep 10, 4:04 PM.

Details

Summary

This patch allows www/node to build and run on powerpc64. It fixes incorrect assumptions between ELFv1/ELFv2 and LE/BE logic.

Tested with LLVM_DEFAULT version set to "90" and "-devel", but it probably works with version"80" too.

Test Plan

Commands on server/node console:

[root@alfredo-2 /usr/ports/www/node]# node
Welcome to Node.js v12.10.0.
Type ".help" for more information.
> var http = require('http');
undefined
> http.createServer(function (req, res) {
...     res.writeHead(200, {'Content-Type': 'text/plain'});
...     res.end('Hello Node.js World!');
... }).listen(8080);
Server {
  _events: [Object: null prototype] {
    request: [Function],
    connection: [Function: connectionListener]
  },
  _eventsCount: 2,
  _maxListeners: undefined,
  _connections: 0,
  _handle: TCP {
    reading: false,
    onconnection: [Function: onconnection],
    [Symbol(owner)]: [Circular]
  },
  _usingWorkers: false,
  _workers: [],
  _unref: false,
  allowHalfOpen: true,
  pauseOnConnect: false,
  httpAllowHalfOpen: false,
  timeout: 120000,
  keepAliveTimeout: 5000,
  maxHeadersCount: null,
  headersTimeout: 40000,
  _connectionKey: '6::::8080',
  [Symbol(IncomingMessage)]: [Function: IncomingMessage],
  [Symbol(ServerResponse)]: [Function: ServerResponse],
  [Symbol(asyncId)]: 223
}
>

From client:

[root@alfredo-2 /usr/ports/www/node]# curl http://localhost:8080
Hello Node.js World![root@alfredo-2 /usr/ports/www/node]# curl -v http://localhost:8080
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.64.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: text/plain
< Date: Tue, 10 Sep 2019 18:59:48 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
< 
* Connection #0 to host localhost left intact
Hello Node.js World!* Closing connection 0

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 26603
Build 24983: arc lint + arc unit

Event Timeline

pkubaj requested changes to this revision.Sat, Sep 21, 3:00 PM

It would be nice if you could apply files/patch-common.gypi only for elfv2, to have node available for elfv1.

This revision now requires changes to proceed.Sat, Sep 21, 3:00 PM
pkubaj updated this revision to Diff 62397.Sat, Sep 21, 7:03 PM
pkubaj edited the summary of this revision. (Show Details)

Remove -mminimal-toc only on 13.

To be committed after the switch to clang.

pkubaj accepted this revision.Sat, Sep 21, 7:04 PM
This revision is now accepted and ready to land.Sat, Sep 21, 7:04 PM